diff options
author | mplayer-svn <svn@mplayerhq.hu> | 2011-11-11 17:29:14 +0000 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-08-03 01:33:55 +0200 |
commit | 6259df531353730306f13aea9e18253bf82ef512 (patch) | |
tree | 831232f30360810ee11a4574bfcc4113ee206cb6 /libmpdemux | |
parent | e687d1e51acd1215a460c55a17c8861b9aa7008f (diff) | |
download | mpv-6259df531353730306f13aea9e18253bf82ef512.tar.bz2 mpv-6259df531353730306f13aea9e18253bf82ef512.tar.xz |
demux_audio: improve WAV format detection
Make WAV format detection more restrictive so it does not incorrectly
grab qcp files.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34343 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_audio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libmpdemux/demux_audio.c b/libmpdemux/demux_audio.c index d3720d2e24..9dbb89ce0f 100644 --- a/libmpdemux/demux_audio.c +++ b/libmpdemux/demux_audio.c @@ -330,6 +330,7 @@ static int demux_audio_open(demuxer_t* demuxer) { mp3_hdr_t *mp3_hdrs = NULL, *mp3_found = NULL; da_priv_t* priv; double duration; + int found_WAVE = 0; s = demuxer->stream; @@ -359,7 +360,7 @@ static int demux_audio_open(demuxer_t* demuxer) { len = (hdr[0]<<21) | (hdr[1]<<14) | (hdr[2]<<7) | hdr[3]; stream_skip(s,len); step = 4; - } else if( hdr[0] == 'f' && hdr[1] == 'm' && hdr[2] == 't' && hdr[3] == ' ' ) { + } else if( found_WAVE && hdr[0] == 'f' && hdr[1] == 'm' && hdr[2] == 't' && hdr[3] == ' ' ) { frmt = WAV; break; } else if((mp3_flen = mp_get_mp3_header(hdr, &mp3_chans, &mp3_freq, @@ -375,6 +376,7 @@ static int demux_audio_open(demuxer_t* demuxer) { if (!mp3_hdrs || mp3_hdrs->cons_hdrs < 3) break; } + found_WAVE = hdr[0] == 'W' && hdr[1] == 'A' && hdr[2] == 'V' && hdr[3] == 'E'; // Add here some other audio format detection if(step < HDR_SIZE) memmove(hdr,&hdr[step],HDR_SIZE-step); |