[FFmpeg-devel] [PATCH 2/2] lavf/utils: bail early if we don't see any packets in an MPEGTS stream

Rodger Combs rodger.combs at gmail.com
Tue May 2 12:07:12 EEST 2017


> On May 2, 2017, at 03:59, Matthias Hunstock <atze at fem.tu-ilmenau.de> wrote:
> 
> Am 02.05.2017 um 03:42 schrieb Rodger Combs:
>> +    max_empty_analyze_duration = max_analyze_duration;
>>     if (!max_analyze_duration) {
>> +        max_empty_analyze_duration =
>>         max_stream_analyze_duration =
>>         max_analyze_duration        = 5*AV_TIME_BASE;
>>         max_subtitle_analyze_duration = 30*AV_TIME_BASE;
>>         if (!strcmp(ic->iformat->name, "flv"))
>>             max_stream_analyze_duration = 90*AV_TIME_BASE;
>> -        if (!strcmp(ic->iformat->name, "mpeg") || !strcmp(ic->iformat->name, "mpegts"))
>> +        if (!strcmp(ic->iformat->name, "mpeg") || !strcmp(ic->iformat->name, "mpegts")) {
>>             max_stream_analyze_duration = 7*AV_TIME_BASE;
>> +            max_empty_analyze_duration = 2*AV_TIME_BASE;
>> +        }
>>     }
> 
> What's the origin of "max_empty_analyze_duration = 2*AV_TIME_BASE;", I
> mean why 2*timebase and not 1 or 3 or 10 ?

Same as any of the other constants here, I'd imagine: seemed about right and worked. I'm actually considering changing it to 1, though.
This doesn't apply to subtitle streams, and audio or video streams generally have at least several packets per second, so streams that are actually active _shouldn't_ be affected even with the smaller value.

> 
> Matthias
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



More information about the ffmpeg-devel mailing list