mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
cmdutils: add codec_opts parameter to setup_find_stream_info_opts()
Avoid brittle and obfuscating reference to a global. Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
ce23ca814b
commit
8ec19f84e1
@ -806,7 +806,7 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum CodecID codec_id, int e
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
AVDictionary **setup_find_stream_info_opts(AVFormatContext *s)
|
AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
AVDictionary **opts;
|
AVDictionary **opts;
|
||||||
|
@ -170,7 +170,7 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum CodecID codec_id, int e
|
|||||||
* @return pointer to the created array of dictionaries, NULL if it
|
* @return pointer to the created array of dictionaries, NULL if it
|
||||||
* cannot be created
|
* cannot be created
|
||||||
*/
|
*/
|
||||||
AVDictionary **setup_find_stream_info_opts(AVFormatContext *s);
|
AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *codec_opts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print an error message to stderr, indicating filename and a human
|
* Print an error message to stderr, indicating filename and a human
|
||||||
|
2
ffmpeg.c
2
ffmpeg.c
@ -3252,7 +3252,7 @@ static int opt_input_file(const char *opt, const char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set AVCodecContext options for avformat_find_stream_info */
|
/* Set AVCodecContext options for avformat_find_stream_info */
|
||||||
opts = setup_find_stream_info_opts(ic);
|
opts = setup_find_stream_info_opts(ic, codec_opts);
|
||||||
orig_nb_streams = ic->nb_streams;
|
orig_nb_streams = ic->nb_streams;
|
||||||
|
|
||||||
/* If not enough info to get the stream parameters, we decode the
|
/* If not enough info to get the stream parameters, we decode the
|
||||||
|
2
ffplay.c
2
ffplay.c
@ -2343,7 +2343,7 @@ static int decode_thread(void *arg)
|
|||||||
if(genpts)
|
if(genpts)
|
||||||
ic->flags |= AVFMT_FLAG_GENPTS;
|
ic->flags |= AVFMT_FLAG_GENPTS;
|
||||||
|
|
||||||
opts = setup_find_stream_info_opts(ic);
|
opts = setup_find_stream_info_opts(ic, codec_opts);
|
||||||
orig_nb_streams = ic->nb_streams;
|
orig_nb_streams = ic->nb_streams;
|
||||||
|
|
||||||
err = avformat_find_stream_info(ic, opts);
|
err = avformat_find_stream_info(ic, opts);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user