[FFmpeg-devel] [RFC][PATCH] return packets for known codecs earlier when codec probing is done
Baptiste Coudurier
baptiste.coudurier
Tue May 26 04:58:02 CEST 2009
On 5/25/2009 7:21 PM, Michael Niedermayer wrote:
> 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() ?
I, too, found that it was messy. Thanks.
Updated patch.
--
Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer http://www.ffmpeg.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: probe_pktl4.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090525/bd2a1a2f/attachment.asc>
More information about the ffmpeg-devel
mailing list