diff mbox series

[FFmpeg-devel,02/23] fftools/ffmpeg: move initializing next_[pd]ts to add_input_streams()

Message ID 20230325191529.10578-2-anton@khirnov.net
State Accepted
Commit 87e9f5ad3c119b1058c66bcc5747f1417e0fbddc
Headers show
Series [FFmpeg-devel,01/23] fftools/ffmpeg: drop InputStream.processing_needed | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Anton Khirnov March 25, 2023, 7:15 p.m. UTC
They are initialized to constants, so it makes most sense to do it as
soon as possible.
---
 fftools/ffmpeg.c       | 3 ---
 fftools/ffmpeg_demux.c | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index aa9284ecd5..abda713ddb 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;