[FFmpeg-devel] [PATCH] wavdec: Fix duration calculation for files with invalid data size

Paul B Mahol onemda at gmail.com
Fri Dec 28 18:10:16 CET 2012


On 12/28/12, James Almer <jamrial at gmail.com> wrote:
> On 28/12/12 8:53 AM, Paul B Mahol wrote:
>> On 12/28/12, Paul B Mahol <onemda at gmail.com> wrote:
>>> On 12/27/12, James Almer <jamrial at gmail.com> wrote:
>>>> Hello.
>>>> The attached patch fixes ticket #2065 for me.
>>>>
>>>> Regards.
>>>>
>>>
>>> lgtm, better than my patch.
>>>
>>
>> Hmm, I think this does not work for files with multiple data chunks.
>
> I didn't notice you posted a patch before mine, sorry.
>
> Does the demuxer even support multiple data chunks properly?
> It seems to me that it only uses the last one it finds, since it seeks to
> its start offset at the end of wav_read_header and stores its end offset
> in wav->data_end, discarding everything from previous data chunks.
>
> The patch should in theory still work with such files, since wav->data_end
> should still be <= than the file size, but i can't be sure since i don't
> have any.
>
> If you think it really wont work then we can drop this patch in favor of
> yours.

Not really, nothing in wav spec says that 0xffffffff is invalid chunk size,
so bug report you try to fix is probably invalid.

And some software like audition did store multiple data chunks when
file would have more that 4gb. This is another hack and not allowed by
spec.
>
> Regards.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list