bugfix: fixing wma files not playing after ffmpeg7 upgrade#758
Open
xicalango wants to merge 3 commits into
Open
bugfix: fixing wma files not playing after ffmpeg7 upgrade#758xicalango wants to merge 3 commits into
xicalango wants to merge 3 commits into
Conversation
fixes github issue clangen#720
mentioned in issue clangen#720
This fixes decoding of files that were broken by the latest changes
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes issue #720 (broken wma playback).
The issue seemed to be with the update on how
channel_layoutswere treated in ffmpeg 7.Details
When debugging I saw that for
wmafiles thecodecContextand thedecodedFrame's channel layout have the order set toAV_CHANNEL_ORDER_UNSPECandu.maskset to0.When the resampler was initialized using
swr_alloc_set_opts2and thecodecContext's channel layout would then return an instance whereorderwas set toAV_CHANNEL_ORDER_NATIVEandu.maskset to3, which then triggered an error withswr_convert_frame.I fixed this by calling
resolveChannelLayoutin case the order is set toAV_CHANNEL_ORDER_UNSPECincodecContext.I'm not super sure if the fix is how ffmpeg wants things to be done, but when testing with a couple of file formats, none of them seemed to break. In fact
wmawas the only one that needed it's channel layout resolved. (I tested with mp3, ogg, opus, flac, wma, m4a, aac).Testing
System I used for testing: Llinux (ubuntu 25.10) with ffmpeg 7.1.1.
I looked through my music library and tried playing all different formats I found and didn't find any issues. I also ran
core_c_demo, but not sure if that did anything meaningful.