Skip to content

Bug in TimeshiftPlayerAacAu - mix-up AudioFormat with number of channels #2

@digidietze

Description

@digidietze

Audio from AAC services with a single audio channel (mono) is scrambled and "micky-moused", which is testable in Germany with "hr-info".

The problem is in TimeshiftPlayerAacAu and its derived classes. They are using android.media.AudioFormat constants assigned to mAudioTrackChannelConfig.

However, this variable is then used with pcmAudioData in the respective AudioTrackSink class which expects the plain number of channels. Since the AudioFormat constants are flags with values unrelated to the number of channels, mono streams get 4 channels and stereo streams get 12. The latter seems to be working by chance, but the former does not.

Using instead a variable like mAudioTrackNumChannels with the plain number of channels (1 = mono, 2 = stereo) solves the problem. AudioFormat is not required anywhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions