[FFmpeg-cvslog] fftools/ffmpeg: move initializing next_[pd]ts to add_input_streams()

Anton Khirnov git at videolan.org
Sun Apr 9 16:50:06 EEST 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Mar 20 17:01:59 2023 +0100| [87e9f5ad3c119b1058c66bcc5747f1417e0fbddc] | committer: Anton Khirnov

fftools/ffmpeg: move initializing next_[pd]ts to add_input_streams()

They are initialized to constants, so it makes most sense to do it as
soon as possible.

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

 fftools/ffmpeg.c       | 3 ---
 fftools/ffmpeg_demux.c | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 3a68640cad..b273f3e477 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2848,9 +2848,6 @@ static int init_input_stream(InputStream *ist, char *error, int error_len)
         assert_avoptions(ist->decoder_opts);
     }
 
-    ist->next_pts = AV_NOPTS_VALUE;
-    ist->next_dts = AV_NOPTS_VALUE;
-
     return 0;
 }
 
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index db05ddb8e9..354d3165c9 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -675,6 +675,9 @@ static void add_input_streams(const OptionsContext *o, Demuxer *d)
         st->discard  = AVDISCARD_ALL;
         ist->nb_samples = 0;
         ist->first_dts = AV_NOPTS_VALUE;
+        ist->next_pts  = AV_NOPTS_VALUE;
+        ist->next_dts  = AV_NOPTS_VALUE;
+
         ds->min_pts = INT64_MAX;
         ds->max_pts = INT64_MIN;
 



More information about the ffmpeg-cvslog mailing list