mild decoder adjustment
This commit is contained in:
@@ -211,13 +211,14 @@ FramePtr FFmpegDecoder::Retrieve(const rational &timecode, const rational &lengt
|
||||
// Set up seeking loop
|
||||
int64_t seek_ts = target_ts;
|
||||
int64_t second_ts = qRound(rational(avstream_->time_base).flipped().toDouble());
|
||||
bool got_frame = false;
|
||||
bool last_backtrack = false;
|
||||
|
||||
// FFmpeg frame retrieve loop
|
||||
while (ret >= 0 && frame_->pts != target_ts) {
|
||||
|
||||
// If the frame timestamp is too large, we need to seek back a little
|
||||
if (frame_->pts > target_ts || frame_->pts == AV_NOPTS_VALUE) {
|
||||
if (got_frame && (frame_->pts > target_ts || frame_->pts == AV_NOPTS_VALUE)) {
|
||||
// If we already tried seeking to 0 though, there's nothing we can do so we error here
|
||||
if (last_backtrack) {
|
||||
Error(tr("FFmpeg failed to seek to the correct location"));
|
||||
@@ -238,6 +239,7 @@ FramePtr FFmpegDecoder::Retrieve(const rational &timecode, const rational &lengt
|
||||
}
|
||||
|
||||
ret = GetFrame();
|
||||
got_frame = true;
|
||||
}
|
||||
|
||||
// Handle any errors received during the frame retrieve process
|
||||
|
||||
Reference in New Issue
Block a user