[FFmpeg-devel] [PATCH] raw_read_header fix

Måns Rullgård mans
Sat Jul 14 03:23:01 CEST 2007


Alex Beregszaszi <alex at rtfs.hu> writes:

> Hi,
>
>> I've seen those too.  The reason the main ffmpeg program doesn't crash
>> is that it sets a default sample rate of 44.1 kHz before opening the
>> input file.
>> 
>> I'm not sure what the best solution to this is.
>
> I'm investigating since then and my findings are that avoiding time_base
> related computations in av_find_stream_info will try decoding.
>
> -        if (av_rescale_q(codec_info_duration[st->index], st->time_base,
> AV_TIME_BASE_Q) >= ic->max_analyze_duration) {
> +        if (st->time_base.den &&
> av_rescale_q(codec_info_duration[st->index], st->time_base,
> AV_TIME_BASE_Q) >= ic->max_analyze_duration) {
>
> Well, if try_decode_frame fails, why shouldn't we give up? And ulaw/alaw
> decoder should fail if no sampling rate is specified as there is no way
> for storing such information in the format itself.

True, but how is the calling app to know that the format lacks this
information beforehand?

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list