From patchwork Mon Jun 27 20:02:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 36490 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8b27:b0:88:1bbf:7fd2 with SMTP id l39csp2226006pzh; Mon, 27 Jun 2022 13:03:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1saZkhaijzFEyfJH7IS+xJDd/YWi/crNGrnbx2/V9rjnLRwNYhnpNWM3zP0O22FTltKHQ+r X-Received: by 2002:a17:907:7204:b0:722:e164:933f with SMTP id dr4-20020a170907720400b00722e164933fmr13971191ejc.768.1656360214160; Mon, 27 Jun 2022 13:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656360214; cv=none; d=google.com; s=arc-20160816; b=STztW9spJWfMvq+jqHJ9pLy9SeJt3fjVhyiP4hAKBk7ZnH75X5EZwnoUjDVoovjNY/ IKYWjLjOTZUgjqETOFAF5a6FUB4OYZO5BAegb4hKIIyD7bTJCn8kMa9GpIrZgQbiB+CY 9HVFVqjXWl0AtN8Fu1vFCFFLhc73TRU+tBaP2i5NJUL01cqtA2Pb+hkfkr+yCL+ZTOBB S8KJtX1rFMC2WdCOtAUIb+oz1h/LLL1eAUiO+xHGUKCoYHFVRR2Sv52c7XmR1VCT16Ix BCXCLqcRSx841mQHOTyuJy4Pj2ZDVAxDcl4TmJulC/G/AHlC9hRr5rYjSY/GbkDEd5Gj s7QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:delivered-to; bh=EzrQZ1IGOlKnLUasoAdOFw/hAHZ+20PvXBIasBqRfLw=; b=rYu/2tHitg2ptau0qZLf7A9Sa6+8uOrwT5aHYvh7uDsbDClHhx3vn90EioHEL2XZc+ M4KPw6uSEVxbyhU8xweVxLlse5cCRUW73WvBYIg1V0wrg3ZIPk4dTZadD8oksk1KvpEo eKMJC4fgzt/wBYSLGdRqqAR9T10zLag2Bswo+LnHVaDwoZ5JwZ7+k61EX3Z1p73HDcRj nuQRxAPnH5Ae2puvOW2dehvLYM1XHrvrPaq6PwOWPBXPpaWJWeXJ3r0he3Q90IZqzPNv CV1rs9sw/0WkEBHE9qBmMosXKLC45+wyoqX3HLDdQy1Gcr8+SO//r4ykjFH03kgiEd2+ TFpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m15-20020a056402510f00b004372b5307cfsi12537365edd.247.2022.06.27.13.03.33; Mon, 27 Jun 2022 13:03:34 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 34F5468B8E8; Mon, 27 Jun 2022 23:03:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5B3B068B8A1 for ; Mon, 27 Jun 2022 23:03:17 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id CBC52E5349; Mon, 27 Jun 2022 22:03:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pUJlhJ7kp4sR; Mon, 27 Jun 2022 22:02:47 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 63D45E7451; Mon, 27 Jun 2022 22:02:47 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 27 Jun 2022 22:02:40 +0200 Message-Id: <20220627200241.7102-2-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220627200241.7102-1-cus@passwd.hu> References: <20220627200241.7102-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] Revert "avformat/demux: Make read_frame_internal() return AVERREOR(EAGAIN) on stuck empty input parser" 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 Cc: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: y2VeDS84y1Sx Hides the underlying real problem with a demuxer returning 0 sized packets. This reverts commit 02699490c14e86105104940c009953081f69432c. --- libavformat/demux.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libavformat/demux.c b/libavformat/demux.c index 57720f4311..1620716716 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -1235,15 +1235,11 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) FFFormatContext *const si = ffformatcontext(s); int ret, got_packet = 0; AVDictionary *metadata = NULL; - int empty = 0; while (!got_packet && !si->parse_queue.head) { AVStream *st; FFStream *sti; - if (empty > 1) - return AVERROR(EAGAIN); - /* read next packet */ ret = ff_read_packet(s, pkt); if (ret < 0) { @@ -1334,8 +1330,6 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) } got_packet = 1; } else if (st->discard < AVDISCARD_ALL) { - if (pkt->size == 0) - empty ++; if ((ret = parse_packet(s, pkt, pkt->stream_index, 0)) < 0) return ret; st->codecpar->sample_rate = sti->avctx->sample_rate;