Hello,
This patch aims to fix a problem I've noticed while working with AEA (Sony 
ATRAC1 comtainer) files.
Right now FFmpeg always exits with an "Input/Output error" when dealing with 
AEA files.
This patch solves that issue by returning AVERROR_EOF once the end of file is 
encountered, instead of always returning AVERROR(EIO).

I am sending this patch again because of an incorrect mime type of the first 
one.

Best regards,Asivery
From cc127ff24d82a04611fac14cf4114a2262f87111 Mon Sep 17 00:00:00 2001
From: asivery <asiv...@protonmail.com>
Date: Tue, 27 Sep 2022 00:13:10 +0200
Subject: [PATCH] avformat/aea: Make it so the AEA demuxer returns EOF at the
 end of file instead of EIO

Signed-off-by: asivery <asiv...@protonmail.com>
---
 libavformat/aea.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/aea.c b/libavformat/aea.c
index f4b39e4f9e..d721398cf5 100644
--- a/libavformat/aea.c
+++ b/libavformat/aea.c
@@ -93,8 +93,11 @@ static int aea_read_packet(AVFormatContext *s, AVPacket *pkt)
     int ret = av_get_packet(s->pb, pkt, s->streams[0]->codecpar->block_align);
 
     pkt->stream_index = 0;
-    if (ret <= 0)
-        return AVERROR(EIO);
+    if (ret <= 0){
+        if(ret < 0)
+            return ret;
+        return AVERROR_EOF;
+    }
 
     return ret;
 }
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to