diff mbox series

[FFmpeg-devel] avformat/demux: Use av_opt_set_int() where appropriate

Message ID PR3PR03MB666514A54DEF109F08DBEE378FDD9@PR3PR03MB6665.eurprd03.prod.outlook.com
State Accepted
Commit cef920853fece79c306c4d1c4873a22013609292
Headers show
Series [FFmpeg-devel] avformat/demux: Use av_opt_set_int() where appropriate
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 17, 2021, 3:44 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
I find it odd that the previous values are not restored, but
rather overwritten with the default value of said option.

 libavformat/demux.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Paul B Mahol Sept. 18, 2021, 10:24 a.m. UTC | #1
probably fine
diff mbox series

Patch

diff --git a/libavformat/demux.c b/libavformat/demux.c
index 714146039f..d7393d5b46 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -1733,7 +1733,7 @@  static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
         goto skip_duration_calc;
     }
 
-    av_opt_set(ic, "skip_changes", "1", AV_OPT_SEARCH_CHILDREN);
+    av_opt_set_int(ic, "skip_changes", 1, AV_OPT_SEARCH_CHILDREN);
     /* estimate the end time (duration) */
     /* XXX: may need to support wrapping */
     filesize = ic->pb ? avio_size(ic->pb) : 0;
@@ -1804,7 +1804,7 @@  static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)
              offset &&
              ++retry <= DURATION_MAX_RETRY);
 
-    av_opt_set(ic, "skip_changes", "0", AV_OPT_SEARCH_CHILDREN);
+    av_opt_set_int(ic, "skip_changes", 0, AV_OPT_SEARCH_CHILDREN);
 
     /* warn about audio/video streams which duration could not be estimated */
     for (unsigned i = 0; i < ic->nb_streams; i++) {
@@ -2412,7 +2412,7 @@  int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
 
     flush_codecs = probesize > 0;
 
-    av_opt_set(ic, "skip_clear", "1", AV_OPT_SEARCH_CHILDREN);
+    av_opt_set_int(ic, "skip_clear", 1, AV_OPT_SEARCH_CHILDREN);
 
     max_stream_analyze_duration = max_analyze_duration;
     max_subtitle_analyze_duration = max_analyze_duration;
@@ -2884,7 +2884,7 @@  int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
     if (probesize)
         estimate_timings(ic, old_offset);
 
-    av_opt_set(ic, "skip_clear", "0", AV_OPT_SEARCH_CHILDREN);
+    av_opt_set_int(ic, "skip_clear", 0, AV_OPT_SEARCH_CHILDREN);
 
     if (ret >= 0 && ic->nb_streams)
         /* We could not have all the codec parameters before EOF. */