Skip to content

Commit

Permalink
Only add frame based threading delay if frame based threading is actu…
Browse files Browse the repository at this point in the history
…ally used
  • Loading branch information
myrsloik committed Feb 27, 2024
1 parent a3335ce commit 30b9747
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/videosource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ FFMS_VideoSource::FFMS_VideoSource(const char *SourceFile, FFMS_Index &Index, in
Delay = CodecContext->delay;
} else {
// In theory we can move this to CodecContext->delay, sort of, one day, maybe. Not now.
Delay = CodecContext->has_b_frames + (CodecContext->thread_count - 1); // Normal decoder delay
Delay = CodecContext->has_b_frames; // Normal decoder delay
if (CodecContext->active_thread_type & FF_THREAD_FRAME) // Adjust for frame based threading
Delay += CodecContext->thread_count - 1;
}

// Always try to decode a frame to make sure all required parameters are known
Expand Down

0 comments on commit 30b9747

Please sign in to comment.