From patchwork Sat Sep 19 16:35:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22484 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 80F8644A83E for ; Sat, 19 Sep 2020 19:37:21 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 597CC68B6F7; Sat, 19 Sep 2020 19:37:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5FF7A68B6C0 for ; Sat, 19 Sep 2020 19:37:14 +0300 (EEST) Received: by mail-wm1-f65.google.com with SMTP id w2so8111039wmi.1 for ; Sat, 19 Sep 2020 09:37:14 -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=xEMKV8JXsMhq32Tw/FtGnsqIA8N3WUM9ZyqeseTpR24=; b=e8mrXX+qsCyInj/Y7MvFX+XSYEFF8FygVphKW7h4/viL1NC7DX/LStgcctcEk4Bf0l HtghXtQPjKf8A7p9K23KjBWeWhZxvAwJBRsreMhOMpOnmAaOqcBtzY4P6Lf7taiFwsvj ngcaIwWlAA4SdKSkQLpDkzD64Nhbc2pZ0iVfNXebARr4HZKemEWM5Nuqd//+jDAewGL/ dunBQH9ZmbM03UVfwoW6XZkBTsaNzR5TVKJEGES4zENlPwneCDZ88+w5UUUH/DpbTzrs RtAO6KOe5+gCnj3epY/c+ZbEvHY0589ZqGDLWxwc5pczZyN2WwIv5oCfDJsIS/Rt2jO5 fQtg== 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=xEMKV8JXsMhq32Tw/FtGnsqIA8N3WUM9ZyqeseTpR24=; b=Lu2SQRHIHUnxsaYt9NH8hwatDUDFkPW+NWKZrBdi7lnFl0TPfCbyL6g62tCEA+KVjm k1txwPMy9a9bCOII7C2EPlzwx7rUquXsIB986eZVTe6Z17P8rrN8ftGxCPUOL1kL1yM+ HMgc+pwsCQti0bOCPFb1SAbVFU3Y9F2T2YIW5SmUiwcr0NJwS0QB/ewnjR2wsgwqyr/9 KSgdPCYScE67zfs/6d/qAuOYpJPUNBPsxfhu7mgpfbC7m2cP2d24BZjB5PEjoakV6CbD sdavoedkLjDt7a2iLGdQwMWpPeffacYu//X4c39Qj6YuFX9WhAOy27J22vmH1sZ4AuA1 6BCA== X-Gm-Message-State: AOAM5326E/CVEqUvB/HlvOCyKvK83pw9klJvDTp45w2DF5p/uYedfrh2 B1KPagF2czXIzYS41NQG82Nid/DxSbk= X-Google-Smtp-Source: ABdhPJzJDlX4sZo5y4YF8BftnIIkkOZOfiuWc12a8b0FYU5k8p7gitGVuzyaSXsyoX0ws37iRCic3w== X-Received: by 2002:a1c:7714:: with SMTP id t20mr20996873wmi.186.1600533433430; Sat, 19 Sep 2020 09:37:13 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1fb0f.dynamic.kabel-deutschland.de. [188.193.251.15]) by smtp.gmail.com with ESMTPSA id d5sm12451137wrb.28.2020.09.19.09.37.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 09:37:12 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 19 Sep 2020 18:35:51 +0200 Message-Id: <20200919163610.1099233-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200919163610.1099233-1-andreas.rheinhardt@gmail.com> References: <20200919163610.1099233-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 02/21] avformat/dashdec: Remove dead code 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" The code in question seems to have been copied from about 70 lines above; yet the code here is only executed if some of the variables (namely representation_segmenttemplate_node and fragment_template_node) are NULL, so it makes no sense to check them for a child element. Also remove a redundant resetting of a pointer to an AVFormatContext after avformat_close_input() (which already sets the pointer to NULL). Signed-off-by: Andreas Rheinhardt --- libavformat/dashdec.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 4048323c7d..f81b323d96 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -1047,12 +1047,7 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url, fragmenturl_node = xmlNextElementSibling(fragmenturl_node); } - fragment_timeline_node = find_child_node_by_name(representation_segmenttemplate_node, "SegmentTimeline"); - - if (!fragment_timeline_node) - fragment_timeline_node = find_child_node_by_name(fragment_template_node, "SegmentTimeline"); - if (!fragment_timeline_node) - fragment_timeline_node = find_child_node_by_name(adaptionset_segmentlist_node, "SegmentTimeline"); + fragment_timeline_node = find_child_node_by_name(adaptionset_segmentlist_node, "SegmentTimeline"); if (!fragment_timeline_node) fragment_timeline_node = find_child_node_by_name(period_segmentlist_node, "SegmentTimeline"); if (fragment_timeline_node) { @@ -1898,7 +1893,6 @@ static void close_demux_for_component(struct representation *pls) memset(&pls->pb, 0x00, sizeof(AVIOContext)); pls->ctx->pb = NULL; avformat_close_input(&pls->ctx); - pls->ctx = NULL; } static int reopen_demux_for_component(AVFormatContext *s, struct representation *pls)