diff options
author | Gyan Doshi <ffmpeg@gyani.pro> | 2022-10-21 19:29:25 +0530 |
---|---|---|
committer | Gyan Doshi <ffmpeg@gyani.pro> | 2022-11-03 14:38:42 +0530 |
commit | 5ccd4d306054cec839e9078203a3b3892a3372a2 (patch) | |
tree | 150b47214861711fb022792ac866b6c738d67b03 /fftools/ffmpeg_demux.c | |
parent | 93faba449c0dc9d953d9aeb381f03728ff66e2cb (diff) | |
download | ffmpeg-5ccd4d306054cec839e9078203a3b3892a3372a2.tar.gz |
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.
Diffstat (limited to 'fftools/ffmpeg_demux.c')
-rw-r--r-- | fftools/ffmpeg_demux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index ca9d3ebfa2..ee867cc15c 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -170,7 +170,7 @@ static void ts_fixup(Demuxer *d, AVPacket *pkt, int *repeat_pict) { InputFile *ifile = &d->f; InputStream *ist = input_streams[ifile->ist_index + pkt->stream_index]; - const int64_t start_time = ifile->ctx->start_time; + const int64_t start_time = ifile->start_time_effective; int64_t duration; if (debug_ts) { @@ -422,7 +422,7 @@ int ifile_get_packet(InputFile *f, AVPacket **pkt) if (f->readrate || f->rate_emu) { int i; int64_t file_start = copy_ts * ( - (f->ctx->start_time != AV_NOPTS_VALUE ? f->ctx->start_time * !start_at_zero : 0) + + (f->start_time_effective != AV_NOPTS_VALUE ? f->start_time_effective * !start_at_zero : 0) + (f->start_time != AV_NOPTS_VALUE ? f->start_time : 0) ); float scale = f->rate_emu ? 1.0 : f->readrate; |