[FFmpeg-cvslog] fftools/ffplay: use cmdutils code for checking remaining avoptions

Marton Balint git at videolan.org
Mon May 27 23:21:29 EEST 2024


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sat May 18 16:03:36 2024 +0200| [4d975571372d64f5feaa7737604190d34b37457f] | committer: Marton Balint

fftools/ffplay: use cmdutils code for checking remaining avoptions

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4d975571372d64f5feaa7737604190d34b37457f
---

 fftools/ffplay.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 5a66bfa38d..ff48fa5f8c 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -2626,7 +2626,6 @@ static int stream_component_open(VideoState *is, int stream_index)
     const AVCodec *codec;
     const char *forced_codec_name = NULL;
     AVDictionary *opts = NULL;
-    const AVDictionaryEntry *t = NULL;
     int sample_rate;
     AVChannelLayout ch_layout = { 0 };
     int ret = 0;
@@ -2694,11 +2693,9 @@ static int stream_component_open(VideoState *is, int stream_index)
     if ((ret = avcodec_open2(avctx, codec, &opts)) < 0) {
         goto fail;
     }
-    if ((t = av_dict_iterate(opts, NULL))) {
-        av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
-        ret =  AVERROR_OPTION_NOT_FOUND;
+    ret = check_avoptions(opts);
+    if (ret < 0)
         goto fail;
-    }
 
     is->eof = 0;
     ic->streams[stream_index]->discard = AVDISCARD_DEFAULT;
@@ -2862,11 +2859,9 @@ static int read_thread(void *arg)
     if (scan_all_pmts_set)
         av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
 
-    if ((t = av_dict_iterate(format_opts, NULL))) {
-        av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
-        ret = AVERROR_OPTION_NOT_FOUND;
+    ret = check_avoptions(format_opts);
+    if (ret < 0)
         goto fail;
-    }
     is->ic = ic;
 
     if (genpts)



More information about the ffmpeg-cvslog mailing list