[Ffmpeg-devel] [PATCH] reduce MAX_SCAN_PACKETS in mpegts.c

Michael Niedermayer michaelni
Sun Aug 27 00:11:12 CEST 2006


Hi

On Sat, Aug 26, 2006 at 10:59:01PM +0200, Nico Sabbi wrote:
> M?ns Rullg?rd wrote:
> 
> >Michael Niedermayer <michaelni at gmx.at> writes:
> >
> > 
> >
> >>Hi
> >>
> >>On Sat, Aug 26, 2006 at 06:08:19PM +0200, Nico Sabbi wrote:
> >>   
> >>
> >>>Hi,
> >>>the current mpegts demuxer is unbearably slow because it wants to scan 
> >>>the
> >>>first 32000 packets (corresponding to almost 6MB) to find usable 
> >>>programs,
> >>>making this demuxer unusable for non local streams (lan, dvb, etc).
> >>>This patch reduces MAX_SCAN_PACKETS to 512 (96KB) that should be enough
> >>>for any decently interleaved stream (out of all my samples not one 
> >>>couldn't
> >>>be played with this patch applied).
> >>>     
> >>>
> >>iam not mpeg-ts demuxer maintainer but IMHO this is unacceptable, make it
> >>user selectable or use timestamps or even time()
> >>   
> >>
> >
> > 
> >
> 
> if I wanted to make this parameters user-settable, would the attached 
> patch be
> acceptable to add an initial support for AVOptions in AVFormatContext?

i think so ...


> (yet, it's still not enough to obtain what I need, because the probesize 
> is set
> after av_open_input_file(&ic, ) ; any advice? )

hmm maybe changing av_open_input_stream() from
    ic = av_alloc_format_context();
    [...]
    *ic_ptr = ic;
to
    if(ap->alloc_context)
        ic = av_alloc_format_context();
    else
        ic= *ic_ptr;
    [...]
    *ic_ptr = ic;

would help?
alternatively you could pass the threshold over AVFormatParameters, but
somehow i never liked AVFormatParameters, as you tend to end up copying
and dupliating variables, it also doesnt fit into the AVOption stuff at
all ...


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list