From patchwork Thu Apr 23 03:07:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 19181 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 3EF6F44BA43 for ; Thu, 23 Apr 2020 06:08:15 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 248B968BDF0; Thu, 23 Apr 2020 06:08:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C410A68BDE8 for ; Thu, 23 Apr 2020 06:08:08 +0300 (EEST) Received: by mail-wr1-f66.google.com with SMTP id j2so5016389wrs.9 for ; Wed, 22 Apr 2020 20:08:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SWY2AfRjeYV2U6lmcQOoHCCkkSPRGsbQdRiD0yOzlMM=; b=tsArQ3eWT7HT5rsUlKX+IKTZ+voxXVh5tg95dZzvXYI5e7tWMSd1RonuQAwhEqu0dG nwjEHc7Tgv8c/ywuAee/txRrkp7F4RgwprqnqFcE4FlvJZHYgDXKRoY17NClX4GqzDr5 qK/ZfHh5BURT8R5t9VU/vt5SeeB3aykIDMK6soumWg1GD8s2lXvwCU2HUgR9bLbNGCCS nxhPQ+JvGrP1/7Otgum2uRdT7LX/6WYAO3qV1yhlzTgniYLdgkvVTvhxCXrVUSbLElAa PKaRpw7DKm/3OnWoGMoCqgGIkERNRJv1cblIDmUmT1UUiVYv4pZPFp6ww0mRSnIoHgYB 62kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SWY2AfRjeYV2U6lmcQOoHCCkkSPRGsbQdRiD0yOzlMM=; b=l3O4xWQMYhYvk2N/nMMz3YwJjtssGiYCT1B525BhzxF+m3fOk0doptolh1U7Ci+RSz cwFPfW/eftZtTjahB3+ZMgJIHpSBmIzJ52EG5Zs1KPVBVTMJzOidVVS4Ltqt1whqrkCM 5+w24Ozmc5dwoTG5G2ljEfRZRkfv75AGFcRoXYAICSx2vLVMQLznTS+1qb6U/69fo1pJ aALylWeaq7IVrHVHrsU2F8fxDfCF6cAOaLgXeD6YYZQIxYh8y1j0e3SqQG1WbVOPWrU9 KPKtQzZVkN7jwXlt5bhakjA9muvpnW9AJQn00xEaa/RuAa6f84B7UpdKtp7mDswfmpWe 5SMQ== X-Gm-Message-State: AGi0Puaid8j2VfycQByEKZh74GB6XoNJVigBMooItF49glzTDSXqIVmi TKHGezfEjf18RrHMqLdJ9o/X0GEm X-Google-Smtp-Source: APiQypLgbTELuY6XvR/xN7pa34yC35Z/AM64+yxuGhYPP8NRn3JSSv2Ln/6ILqFmMt1uT+B7ScY4Kw== X-Received: by 2002:adf:f444:: with SMTP id f4mr2207324wrp.376.1587611287948; Wed, 22 Apr 2020 20:08:07 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1ab57.dynamic.kabel-deutschland.de. [188.193.171.87]) by smtp.gmail.com with ESMTPSA id m1sm1497733wro.64.2020.04.22.20.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 20:08:07 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 23 Apr 2020 05:07:32 +0200 Message-Id: <20200423030741.12158-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200423030741.12158-1-andreas.rheinhardt@gmail.com> References: <20200423030741.12158-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/11] avformat/matroskadec: Simplify check for RealAudio 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" They need a special parsing mode and in order to find out whether this mode is in use, several checks have to be performed. They can all be combined into one: If the buffer that is only used to assemble their packets has been allocated, use the RealAudio parsing mode. Signed-off-by: Andreas Rheinhardt --- libavformat/matroskadec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 8c65e98e77..668323ba08 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3617,11 +3617,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, AVBufferRef *buf for (n = 0; n < laces; n++) { int64_t lace_duration = block_duration*(n+1) / laces - block_duration*n / laces; - if ((st->codecpar->codec_id == AV_CODEC_ID_RA_288 || - st->codecpar->codec_id == AV_CODEC_ID_COOK || - st->codecpar->codec_id == AV_CODEC_ID_SIPR || - st->codecpar->codec_id == AV_CODEC_ID_ATRAC3) && - st->codecpar->block_align && track->audio.sub_packet_size) { + if (track->audio.buf) { res = matroska_parse_rm_audio(matroska, track, st, data, lace_size[n], timecode, pos);