[FFmpeg-devel] [PATCH] ffserver_config: improve AVOption handing
Reynaldo H. Verdejo Pinochet
reynaldo at osg.samsung.com
Sun Nov 2 22:37:37 CET 2014
Hi
On 11/01/2014 03:33 PM, Lukasz Marek wrote:
> [..]
> @@ -517,7 +538,6 @@ static int ffserver_parse_config_feed(FFServerConfig *config, const char *cmd, c
> static int ffserver_apply_stream_config(AVCodecContext *enc, const AVDictionary *conf, AVDictionary **opts)
> {
> AVDictionaryEntry *e;
> - int ret = 0;
>
> /* Return values from ffserver_set_*_param are ignored.
> Values are initially parsed and checked before inserting to AVDictionary. */
> @@ -589,13 +609,8 @@ static int ffserver_apply_stream_config(AVCodecContext *enc, const AVDictionary
> ffserver_set_int_param(&enc->bit_rate, e->value, 0, INT_MIN, INT_MAX, NULL, 0, NULL);
>
> av_opt_set_dict2(enc, opts, AV_OPT_SEARCH_CHILDREN);
> - e = NULL;
> - while (e = av_dict_get(*opts, "", e, AV_DICT_IGNORE_SUFFIX)) {
> - av_log(NULL, AV_LOG_ERROR, "Provided AVOption '%s' doesn't match any existing option.\n", e->key);
> - ret = AVERROR(EINVAL);
> - }
>
> - return ret;
> + return 0;
> }
If you are always returning 0 then this func should probably be
declared static void instead?
> [..]
> diff --git a/ffserver_config.h b/ffserver_config.h
> index f29f07f..c684fb5 100644
> --- a/ffserver_config.h
> +++ b/ffserver_config.h
> @@ -113,6 +113,7 @@ typedef struct FFServerConfig {
> AVDictionary *video_conf; /* Values stored in video AVCodecContext.fields */
> AVDictionary *audio_opts; /* AVOptions for audio encoder */
> AVDictionary *audio_conf; /* Values stored in audio AVCodecContext.fields */
> + AVCodecContext *dummy_ctx; /* Used internally to test AVOptions, not to be used anywere else */
s/anywere/anywhere/g
nit: . Not to be ....
Looks OK, feel free to push after fixing ^
Bests,
--
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
More information about the ffmpeg-devel
mailing list