[FFmpeg-cvslog] libavformat/fifo: Fix initialization of underlying AVFormatContext

Jan Sebechlebsky git at videolan.org
Wed Jul 19 11:31:16 EEST 2017


ffmpeg | branch: master | Jan Sebechlebsky <sebechlebskyjan at gmail.com> | Mon Jul  3 23:45:42 2017 +0200| [5c9dcd5c484f56fb9fb5d277256439f0becce12c] | committer: Jan Sebechlebsky

libavformat/fifo: Fix initialization of underlying AVFormatContext

Muxers may want to directly access filename in stored in
AVFormatContext. For example in case of RTSP, the filename (url)
is used by the muxer to extract parameters of the connection.
These muxers will fail when used with fifo pseudo-muxer.

This commit fixes this issue by passing filename from AVFormatContext
of fifo pseudo-muxer to all AVFormatContext(s) of underlying muxers
during initialization.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan at gmail.com>

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

 libavformat/fifo.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/fifo.c b/libavformat/fifo.c
index 2cbe5c56af..c881f31e94 100644
--- a/libavformat/fifo.c
+++ b/libavformat/fifo.c
@@ -442,13 +442,14 @@ static void *fifo_consumer_thread(void *data)
     return NULL;
 }
 
-static int fifo_mux_init(AVFormatContext *avf, AVOutputFormat *oformat)
+static int fifo_mux_init(AVFormatContext *avf, AVOutputFormat *oformat,
+                         const char *filename)
 {
     FifoContext *fifo = avf->priv_data;
     AVFormatContext *avf2;
     int ret = 0, i;
 
-    ret = avformat_alloc_output_context2(&avf2, oformat, NULL, NULL);
+    ret = avformat_alloc_output_context2(&avf2, oformat, NULL, filename);
     if (ret < 0)
         return ret;
 
@@ -505,7 +506,7 @@ static int fifo_init(AVFormatContext *avf)
         return ret;
     }
 
-    ret = fifo_mux_init(avf, oformat);
+    ret = fifo_mux_init(avf, oformat, avf->filename);
     if (ret < 0)
         return ret;
 



More information about the ffmpeg-cvslog mailing list