1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 07:12:39 +00:00
mpv/audio/decode
wm4 1151dac5f0 audio: use the decoder buffer's format, not sh_audio
When the decoder detects a format change, it overwrites the values
stored in sh_audio (this affects the members sample_format, samplerate,
channels). In the case when the old audio data still needs to be
played/filtered, the audio format as identified by sh_audio and the
format used for the decoder buffer can mismatch. In particular, they
will mismatch in the very unlikely but possible case the audio chain is
reinitialized while old data is draining during a format change.

Or in other words, sh_audio might contain the new format, while the
audio chain is still configured to use the old format.

Currently, the audio code (player/audio.c and init_audio_filters) access
sh_audio to get the current format. This is in theory incorrect for the
reasons mentioned above. Use the decoder buffer's format instead, which
should be correct at any point.
2013-11-18 14:21:00 +01:00
..
ad_lavc.c Merge branch 'planar_audio' 2013-11-12 23:42:04 +01:00
ad_mpg123.c audio: fix mid-stream audio reconfiguration 2013-11-18 14:20:59 +01:00
ad_spdif.c ad_spdif: fix regressions 2013-11-14 23:54:06 +01:00
ad.h audio: add support for using non-interleaved audio from decoders directly 2013-11-12 23:39:09 +01:00
dec_audio.c audio: use the decoder buffer's format, not sh_audio 2013-11-18 14:21:00 +01:00
dec_audio.h audio: switch output to mp_audio_buffer 2013-11-12 23:29:53 +01:00