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

* Re: [FFmpeg-devel] [PATCH] libavformat/aea EOF Patch
  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
  0 siblings, 1 reply; 5+ messages in thread
From: asivery @ 2023-03-04 12:23 UTC (permalink / raw)
  To: ffmpeg-devel

Could someone please take a look? This would improve AEA demuxing, right now every AEA file makes ffmpeg crash with an error.
Thank you in advance :)
------- Original Message -------
On Saturday, October 22nd, 2022 at 7:43 PM, asivery <asivery@protonmail.com> wrote:

> 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
_______________________________________________
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

* Re: [FFmpeg-devel] [PATCH] libavformat/aea EOF Patch
  2023-03-04 12:23 ` asivery
@ 2023-03-08 23:28   ` Marton Balint
  2023-03-09  0:50     ` asivery
  0 siblings, 1 reply; 5+ messages in thread
From: Marton Balint @ 2023-03-08 23:28 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



On Sat, 4 Mar 2023, asivery wrote:

> Could someone please take a look? This would improve AEA demuxing, right now every AEA file makes ffmpeg crash with an error.

The way I see it, you could simply replace the whole body of 
aea_read_packet() with this single line:

return av_get_packet(s->pb, pkt, s->streams[0]->codecpar->block_align);

Regards,
Marton

> Thank you in advance :)
> ------- Original Message -------
> On Saturday, October 22nd, 2022 at 7:43 PM, asivery <asivery@protonmail.com> wrote:
>
>> 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
> _______________________________________________
> 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".
>
_______________________________________________
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

* Re: [FFmpeg-devel] [PATCH] libavformat/aea EOF Patch
  2023-03-08 23:28   ` Marton Balint
@ 2023-03-09  0:50     ` asivery
  2023-03-09 20:16       ` Marton Balint
  0 siblings, 1 reply; 5+ messages in thread
From: asivery @ 2023-03-09  0:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Thank you very much, indeed that works as well.
Here's the updated patch.

Best regards.

---
diff --git a/libavformat/aea.c b/libavformat/aea.c
index f4b39e4f9e..d16217381b 100644
--- a/libavformat/aea.c
+++ b/libavformat/aea.c
@@ -90,13 +90,7 @@ static int aea_read_header(AVFormatContext *s)
 
 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);
-
-    return ret;
+    return av_get_packet(s->pb, pkt, s->streams[0]->codecpar->block_align);
 }
 
 const AVInputFormat ff_aea_demuxer = {

------- Original Message -------
On Thursday, March 9th, 2023 at 12:28 AM, Marton Balint <cus@passwd.hu> wrote:


> 
> On Sat, 4 Mar 2023, asivery wrote:
> 
> > Could someone please take a look? This would improve AEA demuxing, right now every AEA file makes ffmpeg crash with an error.
> 
> 
> The way I see it, you could simply replace the whole body of
> aea_read_packet() with this single line:
> 
> return av_get_packet(s->pb, pkt, s->streams[0]->codecpar->block_align);
> 
> 
> Regards,
> Marton
> 
> > Thank you in advance :)
> > ------- Original Message -------
> > On Saturday, October 22nd, 2022 at 7:43 PM, asivery asivery@protonmail.com wrote:
> > 
> > > 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
> > > _______________________________________________
> > > 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".
> 
> _______________________________________________
> 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".
_______________________________________________
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

* Re: [FFmpeg-devel] [PATCH] libavformat/aea EOF Patch
  2023-03-09  0:50     ` asivery
@ 2023-03-09 20:16       ` Marton Balint
  0 siblings, 0 replies; 5+ messages in thread
From: Marton Balint @ 2023-03-09 20:16 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



On Thu, 9 Mar 2023, asivery wrote:

> Thank you very much, indeed that works as well.
> Here's the updated patch.

Will apply, thanks.

Marton

>
> Best regards.
>
> ---
> diff --git a/libavformat/aea.c b/libavformat/aea.c
> index f4b39e4f9e..d16217381b 100644
> --- a/libavformat/aea.c
> +++ b/libavformat/aea.c
> @@ -90,13 +90,7 @@ static int aea_read_header(AVFormatContext *s)
>
> 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);
> -
> -    return ret;
> +    return av_get_packet(s->pb, pkt, s->streams[0]->codecpar->block_align);
> }
>
> const AVInputFormat ff_aea_demuxer = {
>
> ------- Original Message -------
> On Thursday, March 9th, 2023 at 12:28 AM, Marton Balint <cus@passwd.hu> wrote:
>
>
>>
>> On Sat, 4 Mar 2023, asivery wrote:
>>
>>> Could someone please take a look? This would improve AEA demuxing, right now every AEA file makes ffmpeg crash with an error.
>>
>>
>> The way I see it, you could simply replace the whole body of
>> aea_read_packet() with this single line:
>>
>> return av_get_packet(s->pb, pkt, s->streams[0]->codecpar->block_align);
>>
>>
>> Regards,
>> Marton
>>
>>> Thank you in advance :)
>>> ------- Original Message -------
>>> On Saturday, October 22nd, 2022 at 7:43 PM, asivery asivery@protonmail.com wrote:
>>>
>>>> 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
>>>> _______________________________________________
>>>> 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".
>>
>> _______________________________________________
>> 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".
> _______________________________________________
> 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".
>
_______________________________________________
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