[FFmpeg-devel] [PATCH] libavformat/wtvdec: return AVERROR_EOF on EOF

Nicolas George george at nsup.org
Thu Jun 15 11:22:11 EEST 2017


Le septidi 17 prairial, an CCXXV, Daniel Kucera a écrit :
> Signed-off-by: Daniel Kucera <daniel.kucera at gmail.com>
> ---
>  libavformat/wtvdec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
> index 3ac4501306..ee19fd84da 100644
> --- a/libavformat/wtvdec.c
> +++ b/libavformat/wtvdec.c
> @@ -65,7 +65,7 @@ static int64_t seek_by_sector(AVIOContext *pb, int64_t sector, int64_t offset)
>  }
>  
>  /**
> - * @return bytes read, 0 on end of file, or <0 on error
> + * @return bytes read, AVERROR_EOF on end of file, or <0 on error
>   */
>  static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size)
>  {
> @@ -76,7 +76,7 @@ static int wtvfile_read_packet(void *opaque, uint8_t *buf, int buf_size)
>      if (wf->error || pb->error)
>          return -1;
>      if (wf->position >= wf->length || avio_feof(pb))
> -        return 0;
> +        return AVERROR_EOF;
>  
>      buf_size = FFMIN(buf_size, wf->length - wf->position);
>      while(nread < buf_size) {
> -- 
> 2.11.0

LGTM, but I do not maintain that file.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170615/e0e52e80/attachment.sig>


More information about the ffmpeg-devel mailing list