s->ignore_boundary_point = 0;
s->current_type = AVIO_DATA_MARKER_UNKNOWN;
s->last_time = AV_NOPTS_VALUE;
+ s->short_seek_get = NULL;
++ s->written = 0;
return 0;
}
return s;
}
-static void flush_buffer(AVIOContext *s)
+static void writeout(AVIOContext *s, const uint8_t *data, int len)
{
- if (s->buf_ptr > s->buffer) {
- int size = s->buf_ptr - s->buffer;
- if (!s->error) {
- int ret = 0;
- if (s->write_data_type)
- ret = s->write_data_type(s->opaque, s->buffer,
- size,
- s->current_type,
- s->last_time);
- else if (s->write_packet)
- ret = s->write_packet(s->opaque, s->buffer,
- size);
- if (ret < 0) {
- s->error = ret;
- } else {
- if (s->pos + size > s->written)
- s->written = s->pos + size;
- }
- }
- if (s->current_type == AVIO_DATA_MARKER_SYNC_POINT ||
- s->current_type == AVIO_DATA_MARKER_BOUNDARY_POINT) {
- s->current_type = AVIO_DATA_MARKER_UNKNOWN;
+ if (!s->error) {
+ int ret = 0;
+ if (s->write_data_type)
+ ret = s->write_data_type(s->opaque, (uint8_t *)data,
+ len,
+ s->current_type,
+ s->last_time);
+ else if (s->write_packet)
+ ret = s->write_packet(s->opaque, (uint8_t *)data, len);
+ if (ret < 0) {
+ s->error = ret;
++ } else {
++ if (s->pos + len > s->written)
++ s->written = s->pos + len;
}
- s->last_time = AV_NOPTS_VALUE;
+ }
+ if (s->current_type == AVIO_DATA_MARKER_SYNC_POINT ||
+ s->current_type == AVIO_DATA_MARKER_BOUNDARY_POINT) {
+ s->current_type = AVIO_DATA_MARKER_UNKNOWN;
+ }
+ s->last_time = AV_NOPTS_VALUE;
+ s->writeout_count ++;
+ s->pos += len;
+}
+
+static void flush_buffer(AVIOContext *s)
+{
+ if (s->write_flag && s->buf_ptr > s->buffer) {
+ writeout(s, s->buffer, s->buf_ptr - s->buffer);
if (s->update_checksum) {
s->checksum = s->update_checksum(s->checksum, s->checksum_ptr,
s->buf_ptr - s->checksum_ptr);
#include "libavutil/version.h"
-#define LIBAVFORMAT_VERSION_MAJOR 57
-#define LIBAVFORMAT_VERSION_MINOR 10
-#define LIBAVFORMAT_VERSION_MICRO 2
+// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
+// Also please add any ticket numbers that you believe might be affected here
+#define LIBAVFORMAT_VERSION_MAJOR 57
+#define LIBAVFORMAT_VERSION_MINOR 72
- #define LIBAVFORMAT_VERSION_MICRO 100
++#define LIBAVFORMAT_VERSION_MICRO 101
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \