[FFmpeg-devel] [RFC][PATCH] return packets for known codecs earlier when codec probing is done

Michael Niedermayer michaelni
Tue May 26 04:21:10 CEST 2009


On Mon, May 25, 2009 at 07:17:49PM -0700, Baptiste Coudurier wrote:
> On 5/25/2009 6:39 PM, Michael Niedermayer wrote:
> > On Mon, May 25, 2009 at 01:10:12PM -0700, Baptiste Coudurier wrote:
> > [...]
> >> Index: libavformat/avformat.h
> >> ===================================================================
> >> --- libavformat/avformat.h	(revision 18912)
> >> +++ libavformat/avformat.h	(working copy)
> >> @@ -443,6 +443,12 @@
> >>       * AV_NOPTS_VALUE by default.
> >>       */
> >>      int64_t reference_dts;
> >> +
> >> +    /**
> >> +     * number of packets buffered for codec probing
> >> +     */
> >> +#define MAX_PROBE_PACKETS 100
> >> +    unsigned probe_packets;
> > 
> > i think initializing it to 100 and countig to 0 is more flexible
> > also it should be marked in the doxy as not being part of the public
> > API for now
> > 
> > besides this and the improvment you found, the patch does look ok
> > 
> 
> Ok, patch updated.
[...]
>  avformat.h |    7 +++++++
>  utils.c    |   28 +++++++++++++++++++++++-----
>  2 files changed, 30 insertions(+), 5 deletions(-)
> eed33699893bdbd43917ac615aaf47fc7c90c4c9  probe_pktl3.patch
> Index: libavformat/utils.c
> ===================================================================
> --- libavformat/utils.c	(revision 18912)
> +++ libavformat/utils.c	(working copy)
> @@ -351,7 +351,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
>                           ByteIOContext *pb, const char *filename,
>                           AVInputFormat *fmt, AVFormatParameters *ap)
>  {
> -    int err;
> +    int i, err;
>      AVFormatContext *ic;
>      AVFormatParameters default_ap;
>  
> @@ -391,6 +391,11 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
>              goto fail;
>      }
>  
> +    for (i = 0; i < ic->nb_streams; i++) {
> +        if (ic->streams[i]->codec->codec_id == CODEC_ID_PROBE)
> +            ic->streams[i]->probe_packets = MAX_PROBE_PACKETS;
> +    }
> +
>      if (pb && !ic->data_offset)
>          ic->data_offset = url_ftell(ic->pb);
>  

hmm, does it not work when its done in av_new_stream() ?

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

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090526/2eab2f95/attachment.pgp>



More information about the ffmpeg-devel mailing list