aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2014-12-19 15:23:06 +0200
committerMartin Storsjö <martin@martin.st>2014-12-19 23:13:04 +0200
commite2ce16392205d8efe9143329ed3fb5fcb15498fa (patch)
tree6281ec86dfb34b431d4f2ff3f4b6458c45f55267
parent4895aa65c6ddec2e33ec3c023f221b1bafcbaf9f (diff)
downloadffmpeg-e2ce16392205d8efe9143329ed3fb5fcb15498fa.tar.gz
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@martin.st>
-rw-r--r--libavformat/mpegtsenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 8fa1c3e370..1be4e55683 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];