FFmpeg 4.4: Missing decoded samples

Bug #1934785 reported by Uwe Klotz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Medium
Unassigned

Bug Description

Starting with FFmpeg 4.4 I experience missing samples when decoding MP3 and M4A files. It seems to affect many files while the circumstances are yet unknown.

MP3: 48 missing samples, starting at offset 0
warning [AnalyzerThread 1 #2] ReadAheadFrameBuffer - Missing range [0 -> 47) between output buffer [0 -> 4096) and input buffer [47 -> 1199)

M4A: 64 missing samples, starting at offset 896
warning [AnalyzerThread 1 #2] ReadAheadFrameBuffer - Missing range [896 -> 960) between output buffer [896 -> 4096) and input buffer [960 -> 1984)

The missing samples are replaced with silence which is usually not noticeable right after the start of a track.

Tags: soundsource
Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

This issue might shift markers by 64 samples.

Changed in mixxx:
importance: Low → Medium
Revision history for this message
Be (be.ing) wrote :

Does FFmpeg not have tests upstream that could detect such a regression? It might be worth contributing that upstream.

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

Doesn't look like they do have proper regression tests in place:

1st AAC packet: [-64, 896] ( 960 samples)
2nd AAC packet: [960, 1984] (1024 samples)
all following packets: 1024 samples

The 2nd and all following samples do not account for the lead-in of 64 samples from the 1st packet. It is unclear if those samples need to be ignored (starting from 0) or if the offset of the 1st packet is wrong.

It is definitely a bug in the decoder.

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :

The first audible frame delivered by the decoder should contain 960 valid samples. The first 64 samples of this frame belong to the 1024 + 1024 + 64 = 2112 priming samples that are needed by the decoder.

The length of the first audible frame in AVFrame::nb_samples doesn't seem to account for the priming samples and only counts the audible samples! Unfortunately, this is not documented properly.

Revision history for this message
Uwe Klotz (uklotzde-deactivatedaccount) wrote :
Changed in mixxx:
milestone: none → 2.3.1
assignee: nobody → Uwe Klotz (uklotzde)
status: Confirmed → In Progress
ronso0 (ronso0)
Changed in mixxx:
status: In Progress → Fix Committed
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/10464

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.