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

Submitted by Daniel Kucera on June 5, 2017, 6:28 p.m.

Details

Message ID 20170605182830.18538-1-daniel.kucera@gmail.com
State New
Headers show

Commit Message

Daniel Kucera June 5, 2017, 6:28 p.m.
Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
---
 libavformat/wtvdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Nicolas George June 15, 2017, 8:22 a.m.
Le septidi 17 prairial, an CCXXV, Daniel Kucera a écrit :
> Signed-off-by: Daniel Kucera <daniel.kucera@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,
Daniel Kucera Oct. 13, 2017, 2:46 p.m.
bump.

2017-06-15 10:22 GMT+02:00 Nicolas George <george@nsup.org>:
> Le septidi 17 prairial, an CCXXV, Daniel Kucera a écrit :
>> Signed-off-by: Daniel Kucera <daniel.kucera@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
wm4 Oct. 13, 2017, 3:25 p.m.
On Fri, 13 Oct 2017 16:46:31 +0200
Daniel Kučera <daniel.kucera@gmail.com> wrote:

> bump.

LGTM too. The maintainer is relatively inactive, and it's a small fix
that doesn't even require the maintainer's approval, so I pushed the
patch.

Patch hide | download patch | download mbox

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) {