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

Michael Niedermayer michaelni
Thu May 28 00:00:12 CEST 2009


On Wed, May 27, 2009 at 12:54:27AM -0700, Baptiste Coudurier wrote:
> Hi Michael,
> 
> Michael Niedermayer wrote:
> > [...]
> > 
> >> @@ -537,10 +537,18 @@ int av_read_packet(AVFormatContext *s, AVPacket *p
> >>  
> >>          av_init_packet(pkt);
> >>          ret= s->iformat->read_packet(s, pkt);
> >> -        if (ret < 0)
> >> -            return ret;
> >> +        if (ret < 0) {
> >> +            if (!pktl)
> >> +                return ret;
> >> +            for (i = 0; i < s->nb_streams; i++)
> >> +                if (s->streams[i]->codec->codec_id == CODEC_ID_PROBE)
> >> +                    s->streams[i]->codec->codec_id = CODEC_ID_NONE;
> >> +            continue;
> >> +        }
> > 
> > i dont like this
> > 
> 
> Well, we have a problem if probe_packets is not 0 when eof is reached.
> Do you see another way to avoid this ?

is this special case really relevant?
it just looses data on streams when all of the following is true
* stream is set to CODEC_ID_PROBE
* stream contains less than 100 packets in the whole file
* probing fails even with all packets in the whole file

besides the code also breaks EAGAIN i think

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

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- 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/20090528/9e7c7158/attachment.pgp>



More information about the ffmpeg-devel mailing list