diff options
author | Uoti Urpala <uau@mplayer2.org> | 2012-08-08 23:50:23 +0300 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-08-16 17:16:33 +0200 |
commit | c6b03ffef6250096373c4a81a489dae9fbff9087 (patch) | |
tree | 33f6bf8807a44e4d00bf2ac8ed4409bc564a59ec /libmpdemux/demux_lavf.c | |
parent | 7f0926498c59f87c05fcdc1994d9701d9d5f5bd4 (diff) | |
download | mpv-c6b03ffef6250096373c4a81a489dae9fbff9087.tar.bz2 mpv-c6b03ffef6250096373c4a81a489dae9fbff9087.tar.xz |
demux_lavf: assume audio codec_tag 0 means unset
Libavformat does not distinguish between "no codec_tag given" and
"codec_tag given, value is 0". 0 can be a valid value. Change
demux_lavf to assume that 0 always means unset for audio. This
prevents incorrect selection of the PCM decoder, which includes
"format 0x0" in its codecs.conf entry. The video case accepts 0 iff
codec_id is RAWVIDEO, but there's no obvious similar check possible
for audio. Thus this could possibly cause issues if a file really uses
0 to mean uncompressed audio.
Diffstat (limited to 'libmpdemux/demux_lavf.c')
-rw-r--r-- | libmpdemux/demux_lavf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index b7a8029927..baf013a8ef 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -320,6 +320,8 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) codec->codec_tag = 0; if (!codec->codec_tag) codec->codec_tag = mp_taglist_audio(codec->codec_id); + if (!codec->codec_tag) + codec->codec_tag = -1; wf->wFormatTag = codec->codec_tag; wf->nChannels = codec->channels; wf->nSamplesPerSec = codec->sample_rate; |