[FFmpeg-devel] [PATCH] handle EAGAIN case in ffmpeg.c

Michael Niedermayer michaelni
Wed Sep 12 12:26:02 CEST 2007


Hi

On Wed, Sep 12, 2007 at 11:17:14AM +0200, Benoit Fouet wrote:
> Hi,
> 
> here is a patch to $subj
> 
> what i'm trying to do is having v4l2 working
> 
> this raises a question to me: how can we wait for the driver to give us
> a frame. I think we should wait somewhere, depending on the framerate we
> want.
> should that be done in ffmpeg ?
> have i missed something somewhere ?
> 
> any piece of advice is welcome :)
[...]
> @@ -1910,7 +1910,8 @@
>  
>          /* read a frame from it and output it in the fifo */
>          is = input_files[file_index];
> -        if (av_read_frame(is, &pkt) < 0) {
> +        if ((ret=av_read_frame(is, &pkt)) < 0) {
> +            if (ret != AVERROR(EAGAIN))
>              file_table[file_index].eof_reached = 1;
>              if (opt_shortest)
>                  break;

this will break out of the loop if opt_shortest is set

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

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- 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/20070912/06377626/attachment.pgp>



More information about the ffmpeg-devel mailing list