---
Now w/out messing up the must_flush logic.
libavformat/aviobuf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 98e35f776c..4d9e246e07 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -244,8 +244,10 @@ void avio_write(AVIOContext *s, const unsigned char *buf,
int size)
void avio_flush(AVIOContext *s)
{
- flush_buffer(s);
- s->must_flush = 0;
+ if (!s->max_packet_size || s->buf_ptr - s->buffer >= s->max_packet_size) {
+ flush_buffer(s);
+ s->must_flush = 0;
+ }
}
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
--
2.12.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel