[FFmpeg-cvslog] mpegts: Support running the write_trailer function without an AVIOContext

Martin Storsjö git at videolan.org
Sat Dec 20 00:41:33 CET 2014


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Dec 19 15:23:06 2014 +0200| [e2ce16392205d8efe9143329ed3fb5fcb15498fa] | committer: Martin Storsjö

mpegts: Support running the write_trailer function without an AVIOContext

If opening and closing dynamic buffers as AVIOContext, we may
not have any AVIOContext available when wanting to close and
deallocate the muxer. Allow calling write_trailer despite this.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e2ce16392205d8efe9143329ed3fb5fcb15498fa
---

 libavformat/mpegtsenc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 8fa1c3e..1be4e55 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1192,7 +1192,8 @@ static int mpegts_write_end(AVFormatContext *s)
     MpegTSService *service;
     int i;
 
-    mpegts_write_flush(s);
+    if (s->pb)
+        mpegts_write_flush(s);
 
     for (i = 0; i < s->nb_streams; i++) {
         AVStream *st = s->streams[i];



More information about the ffmpeg-cvslog mailing list