[Ffmpeg-devel] Bug: wav decoder decodes garbage at end of file
Ulrich von Zadow
coder
Mon Jun 26 16:17:23 CEST 2006
Michael Niedermayer wrote:
>>If I read the ffmpeg code correctly, the chunk size is actually read and
>>returned in find_tag (wav.c, 266ff) but then thrown away by wav_read_header
>>(wav.c, 331ff). This value should be used in wav_read_packet to determine
>>whether to set a logical eof state, I think.
>>
>>I made a short attempt at writing a patch, but ran into too many ffmpeg
>>design questions to get very far. For starters, where should the chunk size
>>be stored?
>
> something like WAVContext, though it seems our wav demuxer doesnt have one,
> its private context size is 0, you will have to change that ...
Ok. Does this sound about right?
- Define a WAVContext struct in wav.c that contains a single member
wave_chunk_len.
- Change wav_iformat so memory for the WAVContext is allocated.
- In wav_read_header, set wave_chunk_len
- In wav_read_packet, compare s->data_offset+wave_chunk_len to s->pb->pos to
determine how many bytes are left to read. When none are left, set
s->eof_reached=1.
Cheers,
Uli
More information about the ffmpeg-devel
mailing list