Re: [PATCH] demux lavf: mp_read: Propagate EOF

Nicolas George <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <[email protected]>
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 <[email protected]>
> ---
> 
> 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

_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE6ooRQGBoNzw0KnwPcZVLI8pNxgwFAloIupAACgkQcZVLI8pN
xgyUhhAAsPaQmqBKjqjg3Yq2AaDtJDI8GwLIfl7fVcesenp0+aprSYypEgxdh1+4
WoW6q6gh65+Bl+Sn1NFIjB2/vN1fwxH1vCvx2mUOtreueTymfMEVKM1ktgDmSSQk
6RazbYiZn2CumdHIvRzfA7Gki/WDvyLL+2vTNpiq4oyW26ZZ3lYG+yaolvKRBp7n
00qup9siPJ44w0hnF59yGhpL6k9SDTYAo7T/8V2F1CYfnUlG35OtNOIHr4F/9ucC
5tM4tHDLwn4ohHODpMEZspKOR67oD9gzFclZOd+kus5q55UykmtwX5lCK7fQfVZD
R+32fyvGTNJwH7n5s55cKLydcpL9Yt49GgzIkuH9SxsAJmw4EMwfJmBBKJcs7Unf
Mkj+Y027yT0KLdKOcwBWOqHuVoMQzqzzsmygWW++C7oWlq3RL3c7Q6WBa+6wQp5I
zcMZmgR7Dz171FEKLuoqYSBcjNQ6H3J1u2JTP7rKkY/8I2D3WGz6H7Ry3cn1WZ/i
GE36ZLJJC2DcVnHbRTycwhGSvqun2075nIdl8zozQ77xIjZ2aPEL4I+8zmpUb20S
Mtj1gB4wI4M+lFu4nu5QLBv7iNWAPtXwhYdcBx/CR/LyHY56eHODMxDzo0QU8zus
JHgCzCpQ+4ibAmxpVqVdwzhBCiwmCkYLmXgyONOodTnRtpLYO/I=
=tgw5
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.