diff mbox

[FFmpeg-devel] lavf/bluray: translate a read of 0 to EOF

Message ID 20180506141944.8838-1-jeebjp@gmail.com
State Accepted
Commit b995ec078f42bac95eda18fbd1b4387477b55d0d
Headers show

Commit Message

Jan Ekström May 6, 2018, 2:19 p.m. UTC
Yet another case of forgotten 0 =! EOF translation. The libbluray
documentation specifically mentions that a read of 0 is EOF.

Reported by Fyr on IRC.
---
 libavformat/bluray.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

wm4 May 6, 2018, 2:32 p.m. UTC | #1
On Sun,  6 May 2018 17:19:44 +0300
Jan Ekström <jeebjp@gmail.com> wrote:

> Yet another case of forgotten 0 =! EOF translation. The libbluray
> documentation specifically mentions that a read of 0 is EOF.
> 
> Reported by Fyr on IRC.
> ---
>  libavformat/bluray.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/bluray.c b/libavformat/bluray.c
> index 9282bf9956..635c4f1b87 100644
> --- a/libavformat/bluray.c
> +++ b/libavformat/bluray.c
> @@ -198,7 +198,7 @@ static int bluray_read(URLContext *h, unsigned char *buf, int size)
>  
>      len = bd_read(bd->bd, buf, size);
>  
> -    return len;
> +    return len == 0 ? AVERROR_EOF : len;
>  }
>  
>  static int64_t bluray_seek(URLContext *h, int64_t pos, int whence)

Hilarious, another of those EOf issues. Too bad we didn't just revert
that crap. I wonder how many years it'll take until we got all of them.

LGTM.
Jan Ekström May 6, 2018, 3:55 p.m. UTC | #2
On Sun, May 6, 2018 at 5:32 PM, wm4 <nfxjfg@googlemail.com> wrote:
>
> Hilarious, another of those EOf issues. Too bad we didn't just revert
> that crap. I wonder how many years it'll take until we got all of them.
>
> LGTM.

Thanks, pushed. This should be back-ported to release/4.0 I guess?

Jan
Michael Niedermayer May 6, 2018, 8:16 p.m. UTC | #3
On Sun, May 06, 2018 at 06:55:01PM +0300, Jan Ekström wrote:
> On Sun, May 6, 2018 at 5:32 PM, wm4 <nfxjfg@googlemail.com> wrote:
> >
> > Hilarious, another of those EOf issues. Too bad we didn't just revert
> > that crap. I wonder how many years it'll take until we got all of them.
> >
> > LGTM.
> 
> Thanks, pushed. This should be back-ported to release/4.0 I guess?

probably yes

thanks


[...]
Jan Ekström May 10, 2018, 3:02 p.m. UTC | #4
On Sun, May 6, 2018 at 11:16 PM, Michael Niedermayer
<michael@niedermayer.cc> wrote:
> On Sun, May 06, 2018 at 06:55:01PM +0300, Jan Ekström wrote:
>> Thanks, pushed. This should be back-ported to release/4.0 I guess?
>
> probably yes
>
> thanks
>

Finally got the time, cherry-pick -x'd and pushed to release/4.0.

Jan
diff mbox

Patch

diff --git a/libavformat/bluray.c b/libavformat/bluray.c
index 9282bf9956..635c4f1b87 100644
--- a/libavformat/bluray.c
+++ b/libavformat/bluray.c
@@ -198,7 +198,7 @@  static int bluray_read(URLContext *h, unsigned char *buf, int size)
 
     len = bd_read(bd->bd, buf, size);
 
-    return len;
+    return len == 0 ? AVERROR_EOF : len;
 }
 
 static int64_t bluray_seek(URLContext *h, int64_t pos, int whence)