Web lists-archives.com

Re: [MPlayer-dev-eng] [PATCH] demux lavf: mp_read: Propagate EOF




Le duodi 22 brumaire, an CCXXVI, Alexander Strasser a écrit :
> Return AVERROR_EOF from mp_read callback, if stream->eof is non-zero.
> 
> Fixes ticket #2335
> 
> Signed-off-by: Alexander Strasser <eclipse7@xxxxxxx>
> ---
> 
> Please look at the ticket for more details.
> 
> Although there was a patch committed in FFmpeg, that avoids
> the problem for now, I don't want to wait until the next bump
> re-introduces the problem.
> 
>  libmpdemux/demux_lavf.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
> index 7cb77f7f0..cf960f51a 100644
> --- a/libmpdemux/demux_lavf.c
> +++ b/libmpdemux/demux_lavf.c
> @@ -90,6 +90,8 @@ static int mp_read(void *opaque, uint8_t *buf, int size) {
>      int ret;
>  
>      ret=stream_read(stream, buf, size);
> +    if (!ret && stream->eof)
> +      ret = AVERROR_EOF;
>  
>      mp_msg(MSGT_HEADER,MSGL_DBG2,"%d=mp_read(%p, %p, %d), pos: %"PRId64", eof:%d\n",
>             ret, stream, buf, size, stream_tell(stream), stream->eof);

It looks right to me.

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: Digital signature

_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng