Skip to content

2 channel TrueHD audio doesn't play (regression) #1843

@moneytoo

Description

@moneytoo

Version

Media3 main branch

More version details

main

Devices that reproduce the issue

Samsung Galaxy Z Fold 6

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

Play the attached samples in the demo app (requires FFmpeg extension with TrueHD decoder).

Logcat shows following lines:

Error in avcodec_send_packet: Invalid data found when processing input

Expected result

The sample should play, as it used to work in Media 1.2.0 (FFmpeg 4.2) but broke with the upgrade to 1.2.1 (FFmpeg 6.0).

Actual result

2 channel (stereo) TrueHD doesn't play while surround (for example 5.1 track) works.

I debugged ffmpeg_jni.cc and noticed that the channel layout or channel count were not right with these stereo tracks. So I just created the channel layout and it seemingly fixed the issue.
Then audio played but I had issues with seeking. I fixed that by removing the TrueHD quirk as it was recreating invalid channel layout.

So I'm just sharing my findings here for someone more knowledgeable. I'm no way familiar with the FFmpeg workings so I don't dare to share a PR as I don't know what I changed is right.

Media

https://brouken.com/media/test2-truehd.mkv
https://brouken.com/media/bc.mkv

Bug Report

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions