-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply missing Samples fix only to FFmpeg 4.4 and above
- Loading branch information
Showing
1 changed file
with
16 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1159,24 +1159,27 @@ ReadableSampleFrames SoundSourceFFmpeg::readSampleFramesClamped( | |
} | ||
const auto decodedFrameCount = m_pavDecodedFrame->nb_samples; | ||
DEBUG_ASSERT(decodedFrameCount > 0); | ||
auto streamFrameIndex = | ||
SINT streamFrameIndex = | ||
convertStreamTimeToFrameIndex( | ||
*m_pavStream, m_pavDecodedFrame->pts); | ||
// Only audible samples are counted, i.e. any inaudible aka | ||
// "priming" samples are not included in nb_samples! | ||
// https://bugs.launchpad.net/mixxx/+bug/1934785 | ||
if (streamFrameIndex < kMinFrameIndex) { | ||
|
||
if (m_avutilVersion >= AV_VERSION_INT(56, 52, 100)) { | ||
// From ffmpeg 4.4 only audible samples are counted, i.e. any inaudible aka | ||
// "priming" samples are not included in nb_samples! | ||
// https://github.com/mixxxdj/mixxx/issues/10464 | ||
if (streamFrameIndex < kMinFrameIndex) { | ||
#if VERBOSE_DEBUG_LOG | ||
const auto inaudibleFrameCountUntilStartOfStream = | ||
kMinFrameIndex - streamFrameIndex; | ||
kLogger.debug() | ||
<< "Skipping" | ||
<< inaudibleFrameCountUntilStartOfStream | ||
<< "inaudible sample frames before the start of the stream"; | ||
const auto inaudibleFrameCountUntilStartOfStream = | ||
kMinFrameIndex - streamFrameIndex; | ||
kLogger.debug() | ||
<< "Skipping" | ||
<< inaudibleFrameCountUntilStartOfStream | ||
<< "inaudible sample frames before the start of the stream"; | ||
#endif | ||
streamFrameIndex = kMinFrameIndex; | ||
streamFrameIndex = kMinFrameIndex; | ||
} | ||
} | ||
DEBUG_ASSERT(streamFrameIndex >= kMinFrameIndex); | ||
|
||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
daschuer
Author
Member
|
||
decodedFrameRange = IndexRange::forward( | ||
streamFrameIndex, | ||
decodedFrameCount); | ||
|
Why did you delete this DEBUG_ASSERT?