[FFmpeg-devel] [PATCH] cmdutils: dont call read_header before listing devices

Lukasz Marek lukasz.m.luki2 at gmail.com
Mon Dec 15 00:33:35 CET 2014


List device callback must be able to return valid list without opening device.
This callback should return input values for open function, not vice-versa.
Read header funtion is very likey to fail without proper configuration provided.

Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
---
 cmdutils.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index 06ce5d5..51fd777 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -2069,9 +2069,8 @@ static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
         goto fail;
     }
 
-    /* TODO: avformat_open_input calls read_header callback which is not necessary.
-             Function like avformat_alloc_output_context2 for input could be helpful here. */
     av_dict_copy(&tmp_opts, opts, 0);
+    dev->flags |= AVFMT_FLAG_PRIV_OPT;
     if ((ret = avformat_open_input(&dev, NULL, fmt, &tmp_opts)) < 0) {
         printf("Cannot open device: %s.\n", fmt->name);
         goto fail;
-- 
1.9.1



More information about the ffmpeg-devel mailing list