[MPlayer-dev-eng] [PATCH] demux lavf: mp_read: Propagate EOF
Nicolas George
george at nsup.org
Sun Nov 12 23:18:11 EET 2017
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 at gmx.net>
> ---
>
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20171112/de96053d/attachment.sig>
More information about the MPlayer-dev-eng
mailing list