[FFmpeg-devel] [PATCH] stop av_find_stream_info after reading a certain amount of frames

Michael Niedermayer michaelni
Mon Mar 2 15:19:04 CET 2009


On Sun, Mar 01, 2009 at 08:43:25PM -0800, Baptiste Coudurier wrote:
> Baptiste Coudurier wrote:
> > Marc Mason wrote:
> >> Baptiste Coudurier wrote:
> >>
> >>> Index: libavformat/utils.c
> >>> ===================================================================
> >>> --- libavformat/utils.c	(revision 17505)
> >>> +++ libavformat/utils.c	(working copy)
> >>> @@ -2019,7 +2019,7 @@
> >>>  
> >>>      count = 0;
> >>>      read_size = 0;
> >>> -    for(;;) {
> >>> +    for(; count < 200; ) {
> >> Just wondering. Why not "while (count < 200)" ?
> > 
> > Yes, why not.
> > 
> 
> Michael, can you please comment and propose a better solution if you see
> one.

limiting the loop to 200 iterations wil cause regressions, iam sure of that
but i cant point to some file.
I just know there are files where one stream starts later then the other and
200 isnt all that much


> 
> It seems EAGAIN thing broke FFserver, since there is an infinite loop in
> av_find_stream_info.

what about a solution like:
if(ret == AVERROR(EAGAIN) && strcmp(is->iformat->name, "ffm"))
    continue;
as we have in ffmpeg.c
?


[...] 

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- 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/20090302/a7211d49/attachment.pgp>



More information about the ffmpeg-devel mailing list