diff mbox

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

Message ID 1497728616.3919.17.camel@tmm.cx
State New
Headers show

Commit Message

Hein-Pieter van Braam June 17, 2017, 7:43 p.m. UTC
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@tmm.cx>
---
 libavformat/ipmovie.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.9.4

Comments

Paul B Mahol June 17, 2017, 7:53 p.m. UTC | #1
On 6/17/17, Hein-Pieter van Braam <hp@tmm.cx> wrote:
> 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@tmm.cx>
> ---
>  libavformat/ipmovie.c | 2 ++
>  1 file changed, 2 insertions(+)
>

lgtm
James Almer June 18, 2017, 2:03 p.m. UTC | #2
On 6/17/2017 4:53 PM, Paul B Mahol wrote:
> On 6/17/17, Hein-Pieter van Braam <hp@tmm.cx> wrote:
>> 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@tmm.cx>
>> ---
>>  libavformat/ipmovie.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
> 
> lgtm

Pushed (You could have done it yourself, though).
diff mbox

Patch

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)