[FFmpeg-devel] [PATCH 3/3] lavf/flvdec: use AVERROR_REDO instead of AVERROR(EAGAIN).

wm4 nfxjfg at googlemail.com
Thu Nov 26 20:08:20 CET 2015


On Thu, 26 Nov 2015 19:47:54 +0100
Nicolas George <george at nsup.org> wrote:

> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  libavformat/flvdec.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> index ca73969..96fff68 100644
> --- a/libavformat/flvdec.c
> +++ b/libavformat/flvdec.c
> @@ -882,7 +882,7 @@ retry:
>          }
>  
>          if (size == 0) {
> -            ret = AVERROR(EAGAIN);
> +            ret = AVERROR_REDO;
>              goto leave;
>          }
>  
> @@ -927,13 +927,13 @@ retry:
>                     type, size, flags);
>  skip:
>              avio_seek(s->pb, next, SEEK_SET);
> -            ret = AVERROR(EAGAIN);
> +            ret = AVERROR_REDO;
>              goto leave;
>          }
>  
>          /* skip empty data packets */
>          if (!size) {
> -            ret = AVERROR(EAGAIN);
> +            ret = AVERROR_REDO;
>              goto leave;
>          }
>  
> @@ -973,7 +973,7 @@ skip:
>              || st->discard >= AVDISCARD_ALL
>          ) {
>              avio_seek(s->pb, next, SEEK_SET);
> -            ret = AVERROR(EAGAIN);
> +            ret = AVERROR_REDO;
>              goto leave;
>          }
>  
> @@ -1068,7 +1068,7 @@ retry_duration:
>              if (st->codec->extradata) {
>                  if ((ret = flv_queue_extradata(flv, s->pb, stream_type, size)) < 0)
>                      return ret;
> -                ret = AVERROR(EAGAIN);
> +                ret = AVERROR_REDO;
>                  goto leave;
>              }
>              if ((ret = flv_get_extradata(s, st, size)) < 0)
> @@ -1095,14 +1095,14 @@ retry_duration:
>                  }
>              }
>  
> -            ret = AVERROR(EAGAIN);
> +            ret = AVERROR_REDO;
>              goto leave;
>          }
>      }
>  
>      /* skip empty data packets */
>      if (!size) {
> -        ret = AVERROR(EAGAIN);
> +        ret = AVERROR_REDO;
>          goto leave;
>      }
>  

Better do the looping internal in flvdec.c (if there's no huge number
of other demuxers which need this), instead of adding a new error code
that is also part of the public API.


More information about the ffmpeg-devel mailing list