• Max Kellermann's avatar
    decoder/ffmepg: fill AudioFormat from AVCodecContext, not AVCodecParameters · 6c602811
    Max Kellermann authored
    `AVCodecParameters` contains values from the codec detected by
    avformat_find_stream_info(), but after avcodec_open2(), a different
    codec might be selected with a different `AVSampleFormat`.  This leads
    to misinterpretation of data returned from FFmpeg, leading to random
    noise or silence.
    
    This was observed with FFmpeg 4.0.2 and a TS container file containing
    MP2.  A mp3-float codec was detected returning `AV_SAMPLE_FMT_FLTP`,
    but finally the `mpegaudiodec_fixed.c` was used, returning
    `AV_SAMPLE_FMT_S16`.
    
    By using the audio format from `AVCodecContext`, we ensure that MPD
    and FFmpeg always agree on the actual audio format in the buffer.
    
    This removes the FFmpeg bug workaround from commit e1b032cb which I
    assume is obsolete after 7 years.
    
    Fixes #380
    6c602811
Name
Last commit
Last update
..
AdPlugDecoderPlugin.cxx Loading commit data...
AdPlugDecoderPlugin.h Loading commit data...
AudiofileDecoderPlugin.cxx Loading commit data...
AudiofileDecoderPlugin.hxx Loading commit data...
DsdLib.cxx Loading commit data...
DsdLib.hxx Loading commit data...
DsdiffDecoderPlugin.cxx Loading commit data...
DsdiffDecoderPlugin.hxx Loading commit data...
DsfDecoderPlugin.cxx Loading commit data...
DsfDecoderPlugin.hxx Loading commit data...
FaadDecoderPlugin.cxx Loading commit data...
FaadDecoderPlugin.hxx Loading commit data...
FfmpegDecoderPlugin.cxx Loading commit data...
FfmpegDecoderPlugin.hxx Loading commit data...
FfmpegIo.cxx Loading commit data...
FfmpegIo.hxx Loading commit data...
FfmpegMetaData.cxx Loading commit data...
FfmpegMetaData.hxx Loading commit data...
FlacCommon.cxx Loading commit data...
FlacCommon.hxx Loading commit data...
FlacDecoderPlugin.cxx Loading commit data...
FlacDecoderPlugin.h Loading commit data...
FlacDomain.cxx Loading commit data...
FlacDomain.hxx Loading commit data...
FlacInput.cxx Loading commit data...
FlacInput.hxx Loading commit data...
FlacPcm.cxx Loading commit data...
FlacPcm.hxx Loading commit data...
FlacStreamDecoder.hxx Loading commit data...
FluidsynthDecoderPlugin.cxx Loading commit data...
FluidsynthDecoderPlugin.hxx Loading commit data...
GmeDecoderPlugin.cxx Loading commit data...
GmeDecoderPlugin.hxx Loading commit data...
HybridDsdDecoderPlugin.cxx Loading commit data...
HybridDsdDecoderPlugin.hxx Loading commit data...
MadDecoderPlugin.cxx Loading commit data...
MadDecoderPlugin.hxx Loading commit data...
MikmodDecoderPlugin.cxx Loading commit data...
MikmodDecoderPlugin.hxx Loading commit data...
ModplugDecoderPlugin.cxx Loading commit data...
ModplugDecoderPlugin.hxx Loading commit data...
MpcdecDecoderPlugin.cxx Loading commit data...
MpcdecDecoderPlugin.hxx Loading commit data...
Mpg123DecoderPlugin.cxx Loading commit data...
Mpg123DecoderPlugin.hxx Loading commit data...
OggCodec.cxx Loading commit data...
OggCodec.hxx Loading commit data...
OggDecoder.cxx Loading commit data...
OggDecoder.hxx Loading commit data...
OpusDecoderPlugin.cxx Loading commit data...
OpusDecoderPlugin.h Loading commit data...
OpusDomain.cxx Loading commit data...
OpusDomain.hxx Loading commit data...
OpusHead.cxx Loading commit data...
OpusHead.hxx Loading commit data...
OpusReader.hxx Loading commit data...
OpusTags.cxx Loading commit data...
OpusTags.hxx Loading commit data...
PcmDecoderPlugin.cxx Loading commit data...
PcmDecoderPlugin.hxx Loading commit data...
SidplayDecoderPlugin.cxx Loading commit data...
SidplayDecoderPlugin.hxx Loading commit data...
SndfileDecoderPlugin.cxx Loading commit data...
SndfileDecoderPlugin.hxx Loading commit data...
VorbisDecoderPlugin.cxx Loading commit data...
VorbisDecoderPlugin.h Loading commit data...
VorbisDomain.cxx Loading commit data...
VorbisDomain.hxx Loading commit data...
WavpackDecoderPlugin.cxx Loading commit data...
WavpackDecoderPlugin.hxx Loading commit data...
WildmidiDecoderPlugin.cxx Loading commit data...
WildmidiDecoderPlugin.hxx Loading commit data...
meson.build Loading commit data...