-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix zeros in the first m4a chunk on Linux #11879
Conversation
The SoundSourceProxyTest.firstSoundTest is here in action: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm anything but an expert on audio decoding, but this LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
// Seek to codec frame boundaries if the frame size is fixed and known | ||
if (m_pavStream->codecpar->frame_size > 0) { | ||
seekIndex -= seekIndex % m_pavCodecContext->frame_size; | ||
} | ||
DEBUG_ASSERT(seekIndex >= 0); | ||
DEBUG_ASSERT(seekIndex <= startIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the second debug assertion wouldn't hurt.
Please readd the second debug assert, then I'll merge |
Rebased it back in. |
This starts decoding of the first frame with the required preroll, going to < 1.
Before the reading of the peroll in this region has been skipped (clamped to zero).
Now the FFmpeg soundsource is head up with CoreAudio
Red Line before, Blue line after.
This fixes #11878
The issue has been discovered by a SoundSourceProxyTest.firstSoundTest in my pipeline.
Unfortunately this fix required a waveform re-analyzis if the first sound starts in this region (0 ... 23 ms)
This fix does not introduce an offset so that cue points are not shiftet.