Skip to content

MP3 channel and decoding fix#568

Merged
daschuer merged 7 commits into
mixxxdj:masterfrom
uklotzde:MP3ChannelAndDecodingFix
Apr 25, 2015
Merged

MP3 channel and decoding fix#568
daschuer merged 7 commits into
mixxxdj:masterfrom
uklotzde:MP3ChannelAndDecodingFix

Conversation

@uklotzde
Copy link
Copy Markdown
Contributor

Fixes: https://bugs.launchpad.net/mixxx/+bug/1448224

SoundSourceMp3

  • Accept MP3 files with varying number of channels (1 or 2)
  • Last commit: Fix error handling for libMAD which was severely broken!

The decoding functions do NOT return the actual error code!! Instead
the error code must be read from mad_stream if the decoding functions
returned != 0.

This caused some really ugly sounds at the beginning of some MP3 files,
because frames were not skipped as suppossed to be.
Comment thread src/sources/soundsourcemp3.cpp Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this deserves some more comments. I an not sure where, I am still trying to understand. Please correct me:
"Here we are, if we have decoded a mono sample. This can be either intended or a faulty frame"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"And If we decode a mono file"

@daschuer
Copy link
Copy Markdown
Member

LGTM. Thank you.
Only some doku issues.

Will it simplify the code, if SoundSourceMp3 predicts to be always be stereo?
I am sure it is true anyway in almost all cases.

Slightly more code, but hopefully easier to understand.
@uklotzde
Copy link
Copy Markdown
Contributor Author

Restriction to stereo: It would eliminate the maximum channel calculation and 1 of 3 cases when reading sample data. I don't think that it's worth to alter the code again without any real issues, now that we have a general approach with lots of sanity checks.

If you think about an optimized mono path for audio processing in the future (I often switch the master output to mono) then this artificial restriction could even become counterproductive.

@daschuer
Copy link
Copy Markdown
Member

Thank you for the fix.

There are strange errors at Travis:

Reading tags from file "/home/travis/build/mixxxdj/mixxx/src/test/sine-30.wav" of type "wav" 
Reading tags from file "/home/travis/build/mixxxdj/mixxx/src/test/sine-30.wav" of type "wav" 
Reading tags from file "/home/travis/build/mixxxdj/mixxx/src/test/sine-30.wav" of type "wav" 
in ~EngineMaster() 
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated

I have just build an test this version without such errors. So it is hopefully a server issue.

daschuer added a commit that referenced this pull request Apr 25, 2015
@daschuer daschuer merged commit 65e96f5 into mixxxdj:master Apr 25, 2015
@uklotzde
Copy link
Copy Markdown
Contributor Author

I'm currently seeing test failures on 1.12 for EngineBufferE2ETest.ScratchTest. But on master everything is fine :)

@uklotzde uklotzde deleted the MP3ChannelAndDecodingFix branch May 6, 2015 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants