Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] libavformat/aea EOF Patch
@ 2022-10-22 17:43 asivery
  2023-03-04 12:23 ` asivery
  0 siblings, 1 reply; 5+ messages in thread
From: asivery @ 2022-10-22 17:43 UTC (permalink / raw)
  To: ffmpeg-devel

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-avformat-aea-Make-it-so-the-AEA-demuxer-returns-EOF-.patch --]
[-- Type: text/x-patch; name=0001-avformat-aea-Make-it-so-the-AEA-demuxer-returns-EOF-.patch, Size: 898 bytes --]

From cc127ff24d82a04611fac14cf4114a2262f87111 Mon Sep 17 00:00:00 2001
From: asivery <asivery@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 <asivery@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


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-09 20:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-22 17:43 [FFmpeg-devel] [PATCH] libavformat/aea EOF Patch asivery
2023-03-04 12:23 ` asivery
2023-03-08 23:28   ` Marton Balint
2023-03-09  0:50     ` asivery
2023-03-09 20:16       ` Marton Balint

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git