From patchwork Sat Oct 22 17:43:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: asivery X-Patchwork-Id: 38912 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1379604pzb; Sat, 22 Oct 2022 10:44:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7nVPVzaqSQ/EJl+63QmkYf6gtzN69DjMKlJzCD1jtVJrZZHOB6kGFo5HflrKwCmcVgQnYB X-Received: by 2002:a17:907:968e:b0:7a4:bd01:d7f with SMTP id hd14-20020a170907968e00b007a4bd010d7fmr138648ejc.542.1666460654953; Sat, 22 Oct 2022 10:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666460654; cv=none; d=google.com; s=arc-20160816; b=MymOJ5mqE1pfl+Oz6bBfg+tjTDD1QQi5NRb1LZ3lIw7eYDIA55bxSe6Sn6O6yw+nom P3ab1ayM/8Sxzo8GNJffbxTnVdsnp46fnbfjnYsMUUxTlFhIIv9gkV68PgKe4WFhnfLX SuCFq7ilENwr9GA0IfWeiFEdglCWFZ4Iqs/imoYOBNfOuR6g5TZI7ZgMHdDnVTuSpYrZ 8czvSaLmCqhMFMZXcXztE8D8KshOnREivXy+V/uzsmV7oc8AFbOhXVU4u0zOT11I1pV5 bvttWqeWTRyA5sXKFAFAsDeMZpPyexVeY/ThzR87KHgK354gc6fiW7cz9rO8xAuA3YX2 Ce7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:feedback-id:message-id:from:to:dkim-signature:date :delivered-to; bh=pqStkt3Vi4a3C94kf0V7GZ4Uv6XCuEXwJROz8u3lo0A=; b=bMAiU1KfRgA3q+01TCy1IGYTmz0VKfcUwiLtauU8QOnP52IR50g2SydUagGBbvXR8y e5d4YaH86M7NXtE1SIJZUfn0TWYK8xQa26n8RSG/d/eLIjx0T/tm+SIoC0X9ytceNIxR 7u5rf8ahVnU4yXKovPPTDZE15wYle4OHPjSwVEX6uO9ir9h6i8tSLk6UbCdsNB1P4WFk DE9kF4EIuTUHEKwvwM8PCfctBCJ5SFQs1Z9UfslP0bBTbsKpUF7jKBkY1jM0SeJ0bP4R EUvh5PrtO4lvY+EkGdIhGfMYP/o66N/JvK/7dn8NE1ltg27gRSmy9+Kr44gPjU9LoV20 1NhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@protonmail.com header.s=protonmail3 header.b=PuFL3r7V; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n13-20020aa7c68d000000b0046168e415bcsi2572877edq.211.2022.10.22.10.44.14; Sat, 22 Oct 2022 10:44:14 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@protonmail.com header.s=protonmail3 header.b=PuFL3r7V; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8F27C68BD06; Sat, 22 Oct 2022 20:44:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B5B0268BC35 for ; Sat, 22 Oct 2022 20:44:03 +0300 (EEST) Date: Sat, 22 Oct 2022 17:43:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1666460642; x=1666719842; bh=DjVaN1KUiwETaVUg4sTiajSxgU5McIf952erG3NSW3c=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID; b=PuFL3r7VpdcQH3gWHZc8uJVHiMnhkHt9QVFjtHPncHFdG+bm8UKPwwQ+oiX1xexrJ OjFs4SvpRD2CtR9Cgl8kxO5v1WVaPczlo4xHuKyjbINGRb+o14Y7yAcH37Yj/ST3O9 6vIyu7nIZA7Q3efA84iO2nfIAsoCPaa+5cHSlX0rqEWW6J3OcdpXw/Stx0Vr57TZD+ Z1QUHRbW3pJ5sVXuINB1bjm0jkMdmMx+zvHPTAqLNBLVPgJreeBdQe7/ghsQp7EjCf f95HGoT78s6u9H4u4zUDnm9JkbB6206QQvXfLnqI4z6a7c1hcTMYFduZSdF04OghXi wLQ/hV5+uOzSg== To: "ffmpeg-devel@ffmpeg.org" From: asivery Message-ID: Feedback-ID: 33509725:user:proton MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH] libavformat/aea EOF Patch X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: qS0q/1pg+F1W 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 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 --- 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