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

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


On 15.12.2014 00:33, Lukasz Marek wrote:
> 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;
>

I forgot to amend. Updated patch attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cmdutils-dont-call-read_header-before-listing-device.patch
Type: text/x-patch
Size: 1357 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141215/2f6a4b08/attachment.bin>


More information about the ffmpeg-devel mailing list