From patchwork Sat Sep 19 16:36:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22489 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 50C8F44A83E for ; Sat, 19 Sep 2020 19:37:29 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 34B1568B7A4; Sat, 19 Sep 2020 19:37:29 +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 EE8ED68B75A for ; Sat, 19 Sep 2020 19:37:23 +0300 (EEST) Received: by mail-wm1-f65.google.com with SMTP id e11so8747142wme.0 for ; Sat, 19 Sep 2020 09:37:23 -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=qhECHf3CJ+wpzkm7vYXQIe+0DFdgrYEFZdkbCUSsx5M=; b=u5oiBOMyCc9OrE72W4W5rwZrBvFu7B20jzzpYKwjlcCN2W7Z206zB2Z/ff1fL8y4fC Z2Jda/uGg1ByeLb9E4boELYD+Qsdb346Yi/TD57IwFAfv/dViVqrm78mWp2y2zrZ7TAk 3nb/4EKaBCvINZhW85dDoZeYaRcYa5nYapPFh+X3VBaHQ2oRSH3xTv6FQTCQg4GyHZeX BYnh8QndZ0FUNT75S8gLcMt9sm966+DFOJRiH4xcYEPrk65EJtiPKRFhPJEe3FNwn5oI UIyr3oY/o1HtX0slsG8+VvsS+zAY6uFCNgFkrS5hHHzKASYwd6HmkNR/F4OAp3/dywfN fphQ== 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=qhECHf3CJ+wpzkm7vYXQIe+0DFdgrYEFZdkbCUSsx5M=; b=ukomskdeA1nPBsux/rLJ8REQUYVxgxybov3j52Qv/zAj7HNyWa61ann5ikudYUJ2rt YQYlP56Ipvd99/kgzVkpoQT6Oq7dsC/p7+/wE8Dpq8OoqqTFei8ZI/FeVhXaPUj7yMZ7 rVVUwR8PTDf4d58yu2xBYiKujLumLLVU87vPEHyJyZGhkQw+vNQc7yks2Hl8NEZft0A5 3lnVxYVMLQcMGozF2qmvPLkPVDEd+F1IHxFW9hmYUpyDImDJcLoKyih9ksEIloLy6/xf h9f5y9GodV6rN1dEdcmKNhQ0oNc8MyikJWNI8Ek/4tSDa9SpCfdQ6EqhBs4moBcX3d7A CJpA== X-Gm-Message-State: AOAM531NXqitJ/MIp9b4m7FZVMan5kRdUcFJglk0wwDpz9A0hcv3zTeE 29jVyKMXHhKJImGTXb20BOiOSWwGofc= X-Google-Smtp-Source: ABdhPJy+wa3yETu62PpOuN+bgvd7H4rUCWP+mLt1Aaa8X6/jepxvo6pVuGSg45Iwz7atkmKXs0jV3g== X-Received: by 2002:a05:600c:2118:: with SMTP id u24mr21069693wml.59.1600533442977; Sat, 19 Sep 2020 09:37:22 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 09:37:22 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 19 Sep 2020 18:36:00 +0200 Message-Id: <20200919163610.1099233-11-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 11/21] avformat/dashdec: Remove unused index of representation 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" It is always zero. Also remove other unused elements. Signed-off-by: Andreas Rheinhardt --- libavformat/dashdec.c | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 311a19e425..82cb335de9 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -80,12 +80,8 @@ struct representation { AVIOContext *input; AVFormatContext *parent; AVFormatContext *ctx; - AVPacket pkt; - int rep_idx; - int rep_count; int stream_index; - enum AVMediaType type; char id[20]; char *lang; int bandwidth; @@ -827,9 +823,6 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url, xmlNodePtr adaptionset_supplementalproperty_node) { int32_t ret = 0; - int32_t subtitle_rep_idx = 0; - int32_t audio_rep_idx = 0; - int32_t video_rep_idx = 0; DASHContext *c = s->priv_data; struct representation *rep = NULL; struct fragment *seg = NULL; @@ -1073,15 +1066,12 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url, switch (type) { case AVMEDIA_TYPE_VIDEO: - rep->rep_idx = video_rep_idx; dynarray_add(&c->videos, &c->n_videos, rep); break; case AVMEDIA_TYPE_AUDIO: - rep->rep_idx = audio_rep_idx; dynarray_add(&c->audios, &c->n_audios, rep); break; case AVMEDIA_TYPE_SUBTITLE: - rep->rep_idx = subtitle_rep_idx; dynarray_add(&c->subtitles, &c->n_subtitles, rep); break; default: @@ -1091,10 +1081,6 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url, } } - video_rep_idx += type == AVMEDIA_TYPE_VIDEO; - audio_rep_idx += type == AVMEDIA_TYPE_AUDIO; - subtitle_rep_idx += type == AVMEDIA_TYPE_SUBTITLE; - end: if (rep_id_val) xmlFree(rep_id_val); @@ -1638,10 +1624,10 @@ static struct fragment *get_current_fragment(struct representation *pls) refresh_manifest(pls->parent); } if (pls->cur_seq_no <= min_seq_no) { - av_log(pls->parent, AV_LOG_VERBOSE, "old fragment: cur[%"PRId64"] min[%"PRId64"] max[%"PRId64"], playlist %d\n", (int64_t)pls->cur_seq_no, min_seq_no, max_seq_no, (int)pls->rep_idx); + av_log(pls->parent, AV_LOG_VERBOSE, "old fragment: cur[%"PRId64"] min[%"PRId64"] max[%"PRId64"]\n", (int64_t)pls->cur_seq_no, min_seq_no, max_seq_no); pls->cur_seq_no = calc_cur_seg_no(pls->parent, pls); } else if (pls->cur_seq_no > max_seq_no) { - av_log(pls->parent, AV_LOG_VERBOSE, "new fragment: min[%"PRId64"] max[%"PRId64"], playlist %d\n", min_seq_no, max_seq_no, (int)pls->rep_idx); + av_log(pls->parent, AV_LOG_VERBOSE, "new fragment: min[%"PRId64"] max[%"PRId64"]\n", min_seq_no, max_seq_no); } seg = av_mallocz(sizeof(struct fragment)); if (!seg) { @@ -1712,8 +1698,8 @@ static int open_input(DASHContext *c, struct representation *pls, struct fragmen } ff_make_absolute_url(url, c->max_url_size, c->base_url, seg->url); - av_log(pls->parent, AV_LOG_VERBOSE, "DASH request for url '%s', offset %"PRId64", playlist %d\n", - url, seg->url_offset, pls->rep_idx); + av_log(pls->parent, AV_LOG_VERBOSE, "DASH request for url '%s', offset %"PRId64"\n", + url, seg->url_offset); ret = open_url(pls->parent, &pls->input, url, &c->avio_opts, opts, NULL); cleanup: @@ -1738,8 +1724,7 @@ static int update_init_section(struct representation *pls) ret = open_input(c, pls, pls->init_section); if (ret < 0) { av_log(pls->parent, AV_LOG_WARNING, - "Failed to open an initialization section in playlist %d\n", - pls->rep_idx); + "Failed to open an initialization section\n"); return ret; } @@ -1807,7 +1792,7 @@ restart: ret = AVERROR_EXIT; goto end; } - av_log(v->parent, AV_LOG_WARNING, "Failed to open fragment of playlist %d\n", v->rep_idx); + av_log(v->parent, AV_LOG_WARNING, "Failed to open fragment of playlist\n"); v->cur_seq_no++; goto restart; } @@ -1933,7 +1918,7 @@ static int reopen_demux_for_component(AVFormatContext *s, struct representation pls->ctx->interrupt_callback = s->interrupt_callback; ret = av_probe_input_buffer(&pls->pb, &in_fmt, "", NULL, 0, 0); if (ret < 0) { - av_log(s, AV_LOG_ERROR, "Error when loading first fragment, playlist %d\n", (int)pls->rep_idx); + av_log(s, AV_LOG_ERROR, "Error when loading first fragment of playlist\n"); avformat_free_context(pls->ctx); pls->ctx = NULL; goto fail; @@ -2289,8 +2274,8 @@ static int dash_seek(AVFormatContext *s, struct representation *pls, int64_t see int j = 0; int64_t duration = 0; - av_log(pls->parent, AV_LOG_VERBOSE, "DASH seek pos[%"PRId64"ms], playlist %d%s\n", - seek_pos_msec, pls->rep_idx, dry_run ? " (dry)" : ""); + av_log(pls->parent, AV_LOG_VERBOSE, "DASH seek pos[%"PRId64"ms] %s\n", + seek_pos_msec, dry_run ? " (dry)" : ""); // single fragment mode if (pls->n_fragments == 1) { @@ -2308,8 +2293,8 @@ static int dash_seek(AVFormatContext *s, struct representation *pls, int64_t see if (pls->n_timelines > 0 && pls->fragment_timescale > 0) { int64_t num = pls->first_seq_no; av_log(pls->parent, AV_LOG_VERBOSE, "dash_seek with SegmentTimeline start n_timelines[%d] " - "last_seq_no[%"PRId64"], playlist %d.\n", - (int)pls->n_timelines, (int64_t)pls->last_seq_no, (int)pls->rep_idx); + "last_seq_no[%"PRId64"].\n", + (int)pls->n_timelines, (int64_t)pls->last_seq_no); for (i = 0; i < pls->n_timelines; i++) { if (pls->timelines[i]->starttime > 0) { duration = pls->timelines[i]->starttime; @@ -2330,8 +2315,8 @@ static int dash_seek(AVFormatContext *s, struct representation *pls, int64_t see set_seq_num: pls->cur_seq_no = num > pls->last_seq_no ? pls->last_seq_no : num; - av_log(pls->parent, AV_LOG_VERBOSE, "dash_seek with SegmentTimeline end cur_seq_no[%"PRId64"], playlist %d.\n", - (int64_t)pls->cur_seq_no, (int)pls->rep_idx); + av_log(pls->parent, AV_LOG_VERBOSE, "dash_seek with SegmentTimeline end cur_seq_no[%"PRId64"].\n", + (int64_t)pls->cur_seq_no); } else if (pls->fragment_duration > 0) { pls->cur_seq_no = pls->first_seq_no + ((seek_pos_msec * pls->fragment_timescale) / pls->fragment_duration) / 1000; } else {