Merge commit 'fc308b30bb24e623fed042ec78b10803b2362a18'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 19 Dec 2014 23:41:45 +0000 (00:41 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 19 Dec 2014 23:42:07 +0000 (00:42 +0100)
* commit 'fc308b30bb24e623fed042ec78b10803b2362a18':
  rtpenc_mpegts: Call write_trailer for the mpegts muxer even if no output buffer exists

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rtpenc_mpegts.c

index a8203103da43b0ff7fd5b53750c6dd76582d2d66..e0339bd58d272a9c7d337aa4f2442d44acd703a5 100644 (file)
@@ -32,11 +32,9 @@ static int rtp_mpegts_write_close(AVFormatContext *s)
     struct MuxChain *chain = s->priv_data;
 
     if (chain->mpegts_ctx) {
-        if (!chain->mpegts_ctx->pb)
-            avio_open_dyn_buf(&chain->mpegts_ctx->pb);
+        av_write_trailer(chain->mpegts_ctx);
         if (chain->mpegts_ctx->pb) {
             uint8_t *buf;
-            av_write_trailer(chain->mpegts_ctx);
             avio_close_dyn_buf(chain->mpegts_ctx->pb, &buf);
             av_free(buf);
         }