Skip to content

Commit

Permalink
clamp ffmpeg seeking
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftb0y committed Dec 6, 2023
1 parent 42893f2 commit 012a415
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sources/soundsourceffmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ bool SoundSourceFFmpeg::adjustCurrentPosition(SINT startIndex) {
// sample accurate decoding the actual seek position must be
// placed BEFORE the position where reading continues.
// At the beginning of the stream, this is a negative position.
auto seekIndex = startIndex - m_seekPrerollFrameCount;
SINT seekIndex = std::max(startIndex - m_seekPrerollFrameCount, (SINT)0);

// Seek to codec frame boundaries if the frame size is fixed and known
if (m_pavStream->codecpar->frame_size > 0) {
Expand Down

0 comments on commit 012a415

Please sign in to comment.