From c6b03ffef6250096373c4a81a489dae9fbff9087 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Wed, 8 Aug 2012 23:50:23 +0300 Subject: 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. --- libmpdemux/demux_lavf.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3