From patchwork Thu Jul 16 12:51:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongcheng Zhong X-Patchwork-Id: 21111 Delivered-To: andriy.gelman@gmail.com Received: by 2002:a25:80ca:0:0:0:0:0 with SMTP id c10csp1198453ybm; Thu, 16 Jul 2020 05:52:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAbt29LLuEmykzG4jT2QuLIqrl+K8jUYb+nyG4kvSAUwOcpxpCZQCScT/2PmFu1qluZ9hs X-Received: by 2002:a05:600c:2187:: with SMTP id e7mr4191086wme.171.1594903953884; Thu, 16 Jul 2020 05:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594903953; cv=none; d=google.com; s=arc-20160816; b=tuL415Dh4zHuyajTOTtnPb5up5B427uHPl8zJ7cYjdQU7OzMdvLdnelV1B63H61BHe 3wNIGC2oVu6azBAV4+81samTuUheZBoqD8TsBTnWDlIcEKGC9RNph6elP7FHRXaFw57/ 8OU7+7ClY4KnOsX/fLU+fcJ+OGex87nbhEkdeM8p8mepB4wZ4inF7m0MuarOi/do+aWI RlkyeonRPpbE6LegFh0Czl9Qr83yBxf61aP9qNvcrqYJ4ddEK8c/mWcJCD93KMv2TeYD u8p03L71yj8iQZngeT2dPNv3aNV5S061xWvyC0SIXaHg7rfPZrskbwHmh9rxBdMaYYs2 nBtQ== 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=mXVof2HQXuUHeBy7kPztTbGe45JgOeyx1JdwVArk2s0=; b=smuVXYtblVvkUO7PpkQPPYxA/JH458Yn69I/e8QeaLaQdWt1QVx6GJurOArJofeKsk 1wSvteg2cFvu/XEyGXvOQam944WaXEh/PmN+qmmEbaexZ48mSUTX18EP/hn1Cv872Lm+ jrSt+xblSe4W1L6wfyohx4JTNqC54nM2sZQoDJc3SraTFQ2dmssBTm39Q8OE41c00n7P SNtFOZRYEnOH7wjJar7ysX1b9+t0DYWQNSYTuii1SWpX75x3hUB5ki93Tw7LZp+ZFBBn tLdEuNcXAtDwSMvlNBYrX82G7US7z2WDrwUCjqX9cgXU3lS6N9d5hEZSvCyJR82a/ElI iLMQ== 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 o18si4296217wrq.8.2020.07.16.05.52.33; Thu, 16 Jul 2020 05:52:33 -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 E8E8468B5D7; Thu, 16 Jul 2020 15:51:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp181.sjtu.edu.cn (smtp181.sjtu.edu.cn [202.120.2.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 060C768B5C6 for ; Thu, 16 Jul 2020 15:51:30 +0300 (EEST) Received: from proxy02.sjtu.edu.cn (smtp188.sjtu.edu.cn [202.120.2.188]) by smtp181.sjtu.edu.cn (Postfix) with ESMTPS id 7008B1008D5F4; Thu, 16 Jul 2020 20:51:25 +0800 (CST) Received: from localhost (localhost.localdomain [127.0.0.1]) by proxy02.sjtu.edu.cn (Postfix) with ESMTP id 6B0EC200B448D; Thu, 16 Jul 2020 20:51:25 +0800 (CST) X-Virus-Scanned: amavisd-new at Received: from proxy02.sjtu.edu.cn ([127.0.0.1]) by localhost (proxy02.sjtu.edu.cn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id RLpjOdnBZREP; Thu, 16 Jul 2020 20:51:25 +0800 (CST) Received: from localhost.localdomain (unknown [10.162.157.92]) (Authenticated sender: sj.hc_Zhong@sjtu.edu.cn) by proxy02.sjtu.edu.cn (Postfix) with ESMTPSA id 7D934200B4496; Thu, 16 Jul 2020 20:51:23 +0800 (CST) From: Hongcheng Zhong To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 Jul 2020 20:51:16 +0800 Message-Id: <20200716125116.187031-6-sj.hc_Zhong@sjtu.edu.cn> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200716125116.187031-1-sj.hc_Zhong@sjtu.edu.cn> References: <20200716125116.187031-1-sj.hc_Zhong@sjtu.edu.cn> MIME-Version: 1.0 Subject: [FFmpeg-devel] [RFC][GSoC][PATCH v2 6/6] ffplay: add av_packet_buffer_filter to filter packet buffer X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: spartazhc Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: WG92d4qU8Z/p Content-Length: 1626 From: spartazhc hls_read_header will add all streams to s->internal->packet_buffer. Use av_packet_buffer_filter to remove the AVPackets from other streams that are not needed, otherwise abr will allow them to be added to ffplay's packet_queue. Signed-off-by: spartazhc --- fftools/ffplay.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fftools/ffplay.c b/fftools/ffplay.c index bcee507f40..ba71dbb38e 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -3018,6 +3018,10 @@ static int read_thread(void *arg) /* clean packet list filled in hls_read_header if abr is enabled */ if (abr) { + ret = av_packet_buffer_filter(ic, st_index); + if (ret < 0) { + av_log(NULL, AV_LOG_WARNING, "Failed to clean av_packet\n"); + } is->abr_list = av_mallocz(sizeof(ABRList)); if (!is->abr_list) { ret = AVERROR(ENOMEM);