mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
doc/examples/extract_mvs: Explicitly free options
The user should not rely on all options always being recognized (in particular not on error). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
933308a290
commit
3a5412b39e
@ -104,7 +104,9 @@ static int open_codec_context(AVFormatContext *fmt_ctx, enum AVMediaType type)
|
|||||||
|
|
||||||
/* Init the video decoder */
|
/* Init the video decoder */
|
||||||
av_dict_set(&opts, "flags2", "+export_mvs", 0);
|
av_dict_set(&opts, "flags2", "+export_mvs", 0);
|
||||||
if ((ret = avcodec_open2(dec_ctx, dec, &opts)) < 0) {
|
ret = avcodec_open2(dec_ctx, dec, &opts);
|
||||||
|
av_dict_free(&opts);
|
||||||
|
if (ret < 0) {
|
||||||
fprintf(stderr, "Failed to open %s codec\n",
|
fprintf(stderr, "Failed to open %s codec\n",
|
||||||
av_get_media_type_string(type));
|
av_get_media_type_string(type));
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user