diff --git a/app/codec/ffmpeg/ffmpegdecoder.cpp b/app/codec/ffmpeg/ffmpegdecoder.cpp index 9b2a0da1b..14bcf0e1e 100644 --- a/app/codec/ffmpeg/ffmpegdecoder.cpp +++ b/app/codec/ffmpeg/ffmpegdecoder.cpp @@ -323,7 +323,7 @@ FootageDescription FFmpegDecoder::Probe(const QString &filename, const QAtomicIn int64_t new_dur; do { - new_dur = frame->pts; + new_dur = frame->best_effort_timestamp; } while (instance.GetFrame(pkt, frame) >= 0); avstream->duration = new_dur; @@ -388,7 +388,7 @@ FootageDescription FFmpegDecoder::Probe(const QString &filename, const QAtomicIn int64_t new_dur; do { - new_dur = frame->pts; + new_dur = frame->best_effort_timestamp; } while (instance.GetFrame(pkt, frame) >= 0); avstream->duration = new_dur; @@ -540,7 +540,7 @@ bool FFmpegDecoder::ConformAudioInternal(const QVector &filenames, cons break; } - SignalProcessingProgress(frame->pts, duration); + SignalProcessingProgress(frame->best_effort_timestamp, duration); } wave_out.close(); @@ -733,7 +733,7 @@ FFmpegFramePool::ElementPtr FFmpegDecoder::RetrieveFrame(const rational& time, c if (still_seeking) { // Handle a failure to seek (occurs on some media) // We'll only be here if the frame cache was emptied earlier - if (!cache_at_zero_ && (ret == AVERROR_EOF || working_frame->pts > target_ts)) { + if (!cache_at_zero_ && (ret == AVERROR_EOF || working_frame->best_effort_timestamp > target_ts)) { seek_ts = qMax(min_seek, seek_ts - second_ts_); instance_.Seek(seek_ts); @@ -784,7 +784,7 @@ FFmpegFramePool::ElementPtr FFmpegDecoder::RetrieveFrame(const rational& time, c av_image_copy(&destination_data, &destination_linesize, const_cast(working_frame->data), working_frame->linesize, static_cast(working_frame->format), working_frame->width, working_frame->height); // Set timestamp so this frame can be identified later - cached->set_timestamp(working_frame->pts); + cached->set_timestamp(working_frame->best_effort_timestamp); // Store frame before just in case FFmpegFramePool::ElementPtr previous;