From 5ccd4d306054cec839e9078203a3b3892a3372a2 Mon Sep 17 00:00:00 2001 From: Gyan Doshi Date: Fri, 21 Oct 2022 19:29:25 +0530 Subject: ffmpeg: fix implementation of updated input start time The current adjustment of input start times just adjusts the tsoffset. And it does so, by resetting the tsoffset to nullify the new start time. This leads to breakage of -copyts, ignoring of input_ts_offset, breaking of -isync as well as breaking wrap correction. Fixed by taking cognizance of these parameters, and by correcting start times just before sync offsets are applied. --- fftools/ffmpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fftools/ffmpeg.c') diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 62eb3e374b..e6f6773f6a 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1813,7 +1813,7 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p start_time = 0; if (copy_ts) { start_time += f->start_time != AV_NOPTS_VALUE ? f->start_time : 0; - start_time += start_at_zero ? 0 : f->ctx->start_time; + start_time += start_at_zero ? 0 : f->start_time_effective; } if (ist->pts >= f->recording_time + start_time) { close_output_stream(ost); -- cgit v1.2.3