From patchwork Sun Jun 4 00:25:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3828 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp786285vsk; Sat, 3 Jun 2017 17:26:17 -0700 (PDT) X-Received: by 10.28.137.206 with SMTP id l197mr1465161wmd.41.1496535977407; Sat, 03 Jun 2017 17:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496535977; cv=none; d=google.com; s=arc-20160816; b=yijZSwyHhUGpJoj6yj2px2tNILbCXxV/lysQWDQhqHSVV6hrNNVnbR6A1w0nQHNNrN eYKTE20BQ09mqtVKvh/IAG3gtZNHGAiU/GHhaZmYQW2Y9Ws1L4Kh5xcMkGCHekvYx0tP JDcATkBVq0k7SGl1wVUEMG3wc36mXP+x5Wny7IbqIIyuoOu5leaIyI1gAeKpDn5+fRgY tsevah5Pfak4kwb4MZXgGIW13vqHnv+pRvGWU3M9PXiC+wIvztxkCiGsvb3N8fc4KC0j RRm8j0IOXvLQJCkWEV4PBOqAOivVnNK0gr66gHOo/MLBP8o2SqLj+b/S1LIxyQ2SxHOO AbfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=U5jW6jp9X9la9dcXOsZYdRxXqIFLqARDaPlxWUdfvSQ=; b=IOCVssgE+HKlzp3eJNdN0hh+g7x9KIAHWriyiz1DlYUH0a3OgPEpdIlzG/QLwvYWlE 33OpXzuO9X1qJLrp/oVpSL0eNol8TOV6sKJII61nWaAWDZyHSN5a0c2lOHpsVQtwat6d m0bhAm0J1eP7URgg17RN6vlD6k4FtaUcB594FGxJGMRon+CEfx1y6MReRYVYOiTv1mal k9KTD2riZwZBTKPHsDEwuQimMYVO+ToYp3hv/gj7IipQ8fhatBa8XQiurqluY2jq+bug VtQ/AnIgvlsMAQEQGSW0Z10oujlzvp3Jx9uk2R1hcZRmgVczYo1DA1bDNBvDmQFnNBz8 xFew== 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 v9si2886436wmb.123.2017.06.03.17.26.17; Sat, 03 Jun 2017 17:26:17 -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 B20D1689D31; Sun, 4 Jun 2017 03:25:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-2.mx.upcmail.net (vie01a-dmta-pe01-2.mx.upcmail.net [62.179.121.155]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4789E689D42 for ; Sun, 4 Jun 2017 03:25:51 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dHJMj-00055Q-BU for ffmpeg-devel@ffmpeg.org; Sun, 04 Jun 2017 02:25:57 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id UQRp1v00U0S5wYM01QRqCa; Sun, 04 Jun 2017 02:25:50 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 4 Jun 2017 02:25:46 +0200 Message-Id: <20170604002546.5707-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170604002546.5707-1-michael@niedermayer.cc> References: <20170604002546.5707-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 3/3] avformat/utils: Slightly un-clutter code in determinable_frame_size() by using a switch 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavformat/utils.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index c5f1eac185..bbc7a7b547 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -894,12 +894,13 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt) static int determinable_frame_size(AVCodecContext *avctx) { - if (/*avctx->codec_id == AV_CODEC_ID_AAC ||*/ - avctx->codec_id == AV_CODEC_ID_MP1 || - avctx->codec_id == AV_CODEC_ID_MP2 || - avctx->codec_id == AV_CODEC_ID_MP3/* || - avctx->codec_id == AV_CODEC_ID_CELT*/) + switch(avctx->codec_id) { + case AV_CODEC_ID_MP1: + case AV_CODEC_ID_MP2: + case AV_CODEC_ID_MP3: return 1; + } + return 0; }