[FFmpeg-devel] [PATCH] Cleanly exit at the end of an Interplay MVE

Hein-Pieter van Braam hp at tmm.cx
Sat Jun 17 22:43:36 EEST 2017


Interplay movies signal the end of the stream, currently decoding
continues and eventually returns AVERROR_INVALIDDATA.

This honors the MVE CHUNK_END and CHUNK_SHUTDOWN types.

Signed-off-by: Hein-Pieter van Braam <hp at tmm.cx>
---
 libavformat/ipmovie.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c
index 5636156..b9c128d 100644
--- a/libavformat/ipmovie.c
+++ b/libavformat/ipmovie.c
@@ -702,6 +702,8 @@ static int ipmovie_read_packet(AVFormatContext *s,
         ret = AVERROR(EIO);
     else if (ret == CHUNK_NOMEM)
         ret = AVERROR(ENOMEM);
+    else if (ret == CHUNK_END || ret == CHUNK_SHUTDOWN)
+        ret = AVERROR_EOF;
     else if (ret == CHUNK_VIDEO)
         ret = 0;
     else if (ret == CHUNK_INIT_VIDEO || ret == CHUNK_INIT_AUDIO)
-- 
2.9.4



More information about the ffmpeg-devel mailing list