# HG changeset patch # User melanson # Date 1013838316 0 # Node ID 10ad330c173367069a40b329037757e9c9221e6c # Parent 62eb233b12edc2d4d5a85bda2bdfd1dd673f8a3b fixed WAV demuxer so that it skips to the actual start of the audio data diff -r 62eb233b12ed -r 10ad330c1733 libmpdemux/demux_audio.c --- a/libmpdemux/demux_audio.c Sat Feb 16 01:30:11 2002 +0000 +++ b/libmpdemux/demux_audio.c Sat Feb 16 05:45:16 2002 +0000 @@ -133,6 +133,8 @@ } break; case WAV: { + unsigned int chunk_type; + unsigned int chunk_size; WAVEFORMATEX* w; int l; sh_audio->wf = w = (WAVEFORMATEX*)malloc(sizeof(WAVEFORMATEX)); @@ -152,6 +154,13 @@ l -= 16; if(l) stream_skip(s,l); + do + { + chunk_type = stream_read_fourcc(demuxer->stream); + chunk_size = stream_read_dword_le(demuxer->stream); + if (chunk_type != mmioFOURCC('d', 'a', 't', 'a')) + stream_skip(demuxer->stream, chunk_size); + } while (chunk_type != mmioFOURCC('d', 'a', 't', 'a')); demuxer->movi_start = stream_tell(s); demuxer->movi_end = s->end_pos; } break; @@ -219,7 +228,7 @@ return 1; } default: - printf("Audio demuxer : unknow format %d\n",priv->frmt); + printf("Audio demuxer : unknown format %d\n",priv->frmt); }