summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-11-26 04:47:29 +0200
committerwm4 <wm4@nowhere>2012-12-03 21:08:52 +0100
commit77eac2ec3494080f1dfbc1fd55ff6aba7effd466 (patch)
tree69aa3334412c84ee1773f6c59041e5dcdf5f31c0 /demux/demux_lavf.c
parenta75e65db5defc59a8fca0024bf6559b8b6c0f1ea (diff)
downloadmpv-77eac2ec3494080f1dfbc1fd55ff6aba7effd466.tar.bz2
mpv-77eac2ec3494080f1dfbc1fd55ff6aba7effd466.tar.xz
audio: improve decoder open failure handling
Reinitialize sh_audio->samplesize and sample_format before falling back to another audio decoder (some decoders rely on default values). Remove code setting these fields from demux_mkv and demux_lavf (no decoder should depend on demuxer-set values for these fields). Conflicts: audio/decode/ad_lavc.c Merged from mplayer2 commit 6b9567. The changes to ad_lavc.c are not merged, as they are very specific to the mplayer2 libavresample hack; we deplanarize manually, so we can't get unsupported sample formats yet (except on raw audio with "pcm_f64le", as we don't support AV_SAMPLE_FMT_DBL in the audio chain).
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 9cf36207a3..c1c15f345a 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -389,16 +389,6 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i)
sh_audio->samplerate = codec->sample_rate;
sh_audio->i_bps = codec->bit_rate / 8;
switch (codec->codec_id) {
- case CODEC_ID_PCM_S8:
- case CODEC_ID_PCM_U8:
- sh_audio->samplesize = 1;
- break;
- case CODEC_ID_PCM_S16LE:
- case CODEC_ID_PCM_S16BE:
- case CODEC_ID_PCM_U16LE:
- case CODEC_ID_PCM_U16BE:
- sh_audio->samplesize = 2;
- break;
case CODEC_ID_PCM_ALAW:
sh_audio->format = 0x6;
break;