[PATCH] demux lavf: mp_read: Propagate EOF

Alexander Strasser <[email protected]>
Newsgroups gmane.comp.video.mplayer.devel
Message-ID <4c0d926968a30da6f65ee76aaa9260d5a6fb5f7b.1510516236.git.eclipse7@gmx.net>
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);
-- 
_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
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.