From patchwork Sat Sep 19 16:36:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22500 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 169A34493ED for ; Sat, 19 Sep 2020 19:39:54 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E6BFB68B8E2; Sat, 19 Sep 2020 19:37:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6455968B877 for ; Sat, 19 Sep 2020 19:37:33 +0300 (EEST) Received: by mail-wm1-f67.google.com with SMTP id l15so8736901wmh.1 for ; Sat, 19 Sep 2020 09:37:33 -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=hNKUqWsPOpJiGUPHV8DBvYiQReLdN1cH6mMvxfGt45E=; b=EZo2/EojPR1B7yq5z2+mXzuYCE6Y+17wOsU2aFOUYyr/lU9yHoh8I0WDHmr+be1kza ISq89S9DnMntlWzJvvROjIDhbW3jo7NVSYCy9ZXmvdsrOozTtLNB8jE6Ash0i8G0h3+q Q/an68GKpcC+yUCu7Y2E5IKvFjRICSDXAFmCyaeHeIRq1QyvnbINq3EVss40Non+lKUS 72DtueSUhKME8Q2GPT52BKu0EivFfYbTbq5TQ3i1cyzl7Dut8VsD3mPh6ULcGzyQbh3T 3OnH9p6EHhyr/r8DiyTMgAo4BXfvg5mhjtmZHLEVMUVTLzbdeQClLPnQd+pPnn0U0wES LP1w== 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=hNKUqWsPOpJiGUPHV8DBvYiQReLdN1cH6mMvxfGt45E=; b=TBVXHNojRIwwJWA8yb5M4ptooSQyJhBENYpJyWaB2cmJe5xuXFEzIsp8xGIEQDD6ag ox7a88LqPHhaX4f/rcpGPs4Id1NoiPTM213TGn7SQMDZu29DmUx9encl6b1Mk7QyQh89 ckq2OCl4DupRLY1k+MQZ2TImg1euEokc8boSagSXlblvTZh5lTi6/nqK6W+oKYuqfmcM O2cEddHDC7ybmVJYi5ttgnsvrhbcFd1Xp03RZItdzYQIcbESXmlPyIAdS/G85Ym+oYmj 5LUcxea0J3avEdzt0U7MgJN2iZaL/b1DnvIm+Jg7lfYcxr9VsbtKNmsfba5zbIfL8XlO mKYw== X-Gm-Message-State: AOAM532JreJw8S3qUGyhePYrjtctnFdyQGqcgZgX/UkfZfy4JQPaVj8m Eg52lv+mshB6GZXCJbr5womGcQLV4TY= X-Google-Smtp-Source: ABdhPJxnRWbIOgH7PRSK0pH7wsU44WmY+Fb58NAe9wWresvTgR014WMeaNTiiB0LdYyBSGtxs/xQjA== X-Received: by 2002:a1c:9a57:: with SMTP id c84mr21050178wme.136.1600533452315; Sat, 19 Sep 2020 09:37:32 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2020 09:37:31 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 19 Sep 2020 18:36:07 +0200 Message-Id: <20200919163610.1099233-18-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 18/21] avformat/dashdec: Remove redundant casts to const 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" Signed-off-by: Andreas Rheinhardt --- libavformat/dashdec.c | 90 +++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index 3b6ae29b1b..71c6b5cc1a 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -497,7 +497,7 @@ static char *get_content_url(xmlNodePtr *baseurl_nodes, ff_make_absolute_url(tmp_str, max_url_size, tmp_str, val); if (rep_id_val) { - url = av_strireplace(tmp_str, "$RepresentationID$", (const char*)rep_id_val); + url = av_strireplace(tmp_str, "$RepresentationID$", rep_id_val); if (!url) { goto end; } @@ -506,7 +506,7 @@ static char *get_content_url(xmlNodePtr *baseurl_nodes, if (rep_bandwidth_val && tmp_str[0] != '\0') { // free any previously assigned url before reassigning av_free(url); - url = av_strireplace(tmp_str, "$Bandwidth$", (const char*)rep_bandwidth_val); + url = av_strireplace(tmp_str, "$Bandwidth$", rep_bandwidth_val); if (!url) { goto end; } @@ -562,11 +562,11 @@ static enum AVMediaType get_content_type(xmlNodePtr node) attr = i ? "mimeType" : "contentType"; val = xmlGetProp(node, attr); if (val) { - if (av_stristr((const char *)val, "video")) { + if (av_stristr(val, "video")) { type = AVMEDIA_TYPE_VIDEO; - } else if (av_stristr((const char *)val, "audio")) { + } else if (av_stristr(val, "audio")) { type = AVMEDIA_TYPE_AUDIO; - } else if (av_stristr((const char *)val, "text")) { + } else if (av_stristr(val, "text")) { type = AVMEDIA_TYPE_SUBTITLE; } xmlFree(val); @@ -607,7 +607,7 @@ static int parse_manifest_segmenturlnode(AVFormatContext *s, struct representati int max_url_size = c ? c->max_url_size: MAX_URL_SIZE; int err; - if (!av_strcasecmp(fragmenturl_node->name, (const char *)"Initialization")) { + if (!av_strcasecmp(fragmenturl_node->name, "Initialization")) { initialization_val = xmlGetProp(fragmenturl_node, "sourceURL"); range_val = xmlGetProp(fragmenturl_node, "range"); if (initialization_val || range_val) { @@ -629,7 +629,7 @@ static int parse_manifest_segmenturlnode(AVFormatContext *s, struct representati return AVERROR(ENOMEM); } } - } else if (!av_strcasecmp(fragmenturl_node->name, (const char *)"SegmentURL")) { + } else if (!av_strcasecmp(fragmenturl_node->name, "SegmentURL")) { media_val = xmlGetProp(fragmenturl_node, "media"); range_val = xmlGetProp(fragmenturl_node, "mediaRange"); if (media_val || range_val) { @@ -667,7 +667,7 @@ static int parse_manifest_segmenttimeline(AVFormatContext *s, struct representat char *val = NULL; int err; - if (!av_strcasecmp(fragment_timeline_node->name, (const char *)"S")) { + if (!av_strcasecmp(fragment_timeline_node->name, "S")) { struct timeline *tml = av_mallocz(sizeof(struct timeline)); if (!tml) { return AVERROR(ENOMEM); @@ -681,11 +681,11 @@ static int parse_manifest_segmenttimeline(AVFormatContext *s, struct representat continue; } - if (!av_strcasecmp(attr->name, (const char *)"t")) { + if (!av_strcasecmp(attr->name, "t")) { tml->starttime = (int64_t)strtoll(val, NULL, 10); - } else if (!av_strcasecmp(attr->name, (const char *)"r")) { + } else if (!av_strcasecmp(attr->name, "r")) { tml->repeat =(int64_t) strtoll(val, NULL, 10); - } else if (!av_strcasecmp(attr->name, (const char *)"d")) { + } else if (!av_strcasecmp(attr->name, "d")) { tml->duration = (int64_t)strtoll(val, NULL, 10); } attr = attr->next; @@ -1044,7 +1044,7 @@ static int parse_manifest_representation(AVFormatContext *s, const char *url, } } } else { - av_log(s, AV_LOG_ERROR, "Unknown format of Representation node id[%s] \n", (const char *)rep_id_val); + av_log(s, AV_LOG_ERROR, "Unknown format of Representation node id[%s] \n", rep_id_val); goto free; } @@ -1126,17 +1126,17 @@ static int parse_manifest_adaptationset(AVFormatContext *s, const char *url, node = xmlFirstElementChild(adaptionset_node); while (node) { - if (!av_strcasecmp(node->name, (const char *)"SegmentTemplate")) { + if (!av_strcasecmp(node->name, "SegmentTemplate")) { fragment_template_node = node; - } else if (!av_strcasecmp(node->name, (const char *)"ContentComponent")) { + } else if (!av_strcasecmp(node->name, "ContentComponent")) { content_component_node = node; - } else if (!av_strcasecmp(node->name, (const char *)"BaseURL")) { + } else if (!av_strcasecmp(node->name, "BaseURL")) { adaptionset_baseurl_node = node; - } else if (!av_strcasecmp(node->name, (const char *)"SegmentList")) { + } else if (!av_strcasecmp(node->name, "SegmentList")) { adaptionset_segmentlist_node = node; - } else if (!av_strcasecmp(node->name, (const char *)"SupplementalProperty")) { + } else if (!av_strcasecmp(node->name, "SupplementalProperty")) { adaptionset_supplementalproperty_node = node; - } else if (!av_strcasecmp(node->name, (const char *)"Representation")) { + } else if (!av_strcasecmp(node->name, "Representation")) { ret = parse_manifest_representation(s, url, node, adaptionset_node, mpd_baseurl_node, @@ -1258,7 +1258,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) } if (node->type != XML_ELEMENT_NODE || - av_strcasecmp(node->name, (const char *)"MPD")) { + av_strcasecmp(node->name, "MPD")) { ret = AVERROR_INVALIDDATA; av_log(s, AV_LOG_ERROR, "Unable to parse '%s' - wrong root node name[%s] type[%d]\n", url, node->name, (int)node->type); goto cleanup; @@ -1270,7 +1270,7 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) ret = AVERROR_INVALIDDATA; goto cleanup; } - if (!av_strcasecmp(val, (const char *)"dynamic")) + if (!av_strcasecmp(val, "dynamic")) c->is_live = 1; xmlFree(val); @@ -1278,29 +1278,29 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) while (attr) { val = xmlGetProp(node, attr->name); - if (!av_strcasecmp(attr->name, (const char *)"availabilityStartTime")) { - c->availability_start_time = get_utc_date_time_insec(s, (const char *)val); + if (!av_strcasecmp(attr->name, "availabilityStartTime")) { + c->availability_start_time = get_utc_date_time_insec(s, val); av_log(s, AV_LOG_TRACE, "c->availability_start_time = [%"PRId64"]\n", c->availability_start_time); - } else if (!av_strcasecmp(attr->name, (const char *)"availabilityEndTime")) { - c->availability_end_time = get_utc_date_time_insec(s, (const char *)val); + } else if (!av_strcasecmp(attr->name, "availabilityEndTime")) { + c->availability_end_time = get_utc_date_time_insec(s, val); av_log(s, AV_LOG_TRACE, "c->availability_end_time = [%"PRId64"]\n", c->availability_end_time); - } else if (!av_strcasecmp(attr->name, (const char *)"publishTime")) { - c->publish_time = get_utc_date_time_insec(s, (const char *)val); + } else if (!av_strcasecmp(attr->name, "publishTime")) { + c->publish_time = get_utc_date_time_insec(s, val); av_log(s, AV_LOG_TRACE, "c->publish_time = [%"PRId64"]\n", c->publish_time); - } else if (!av_strcasecmp(attr->name, (const char *)"minimumUpdatePeriod")) { - c->minimum_update_period = get_duration_insec(s, (const char *)val); + } else if (!av_strcasecmp(attr->name, "minimumUpdatePeriod")) { + c->minimum_update_period = get_duration_insec(s, val); av_log(s, AV_LOG_TRACE, "c->minimum_update_period = [%"PRId64"]\n", c->minimum_update_period); - } else if (!av_strcasecmp(attr->name, (const char *)"timeShiftBufferDepth")) { - c->time_shift_buffer_depth = get_duration_insec(s, (const char *)val); + } else if (!av_strcasecmp(attr->name, "timeShiftBufferDepth")) { + c->time_shift_buffer_depth = get_duration_insec(s, val); av_log(s, AV_LOG_TRACE, "c->time_shift_buffer_depth = [%"PRId64"]\n", c->time_shift_buffer_depth); - } else if (!av_strcasecmp(attr->name, (const char *)"minBufferTime")) { - c->min_buffer_time = get_duration_insec(s, (const char *)val); + } else if (!av_strcasecmp(attr->name, "minBufferTime")) { + c->min_buffer_time = get_duration_insec(s, val); av_log(s, AV_LOG_TRACE, "c->min_buffer_time = [%"PRId64"]\n", c->min_buffer_time); - } else if (!av_strcasecmp(attr->name, (const char *)"suggestedPresentationDelay")) { - c->suggested_presentation_delay = get_duration_insec(s, (const char *)val); + } else if (!av_strcasecmp(attr->name, "suggestedPresentationDelay")) { + c->suggested_presentation_delay = get_duration_insec(s, val); av_log(s, AV_LOG_TRACE, "c->suggested_presentation_delay = [%"PRId64"]\n", c->suggested_presentation_delay); - } else if (!av_strcasecmp(attr->name, (const char *)"mediaPresentationDuration")) { - c->media_presentation_duration = get_duration_insec(s, (const char *)val); + } else if (!av_strcasecmp(attr->name, "mediaPresentationDuration")) { + c->media_presentation_duration = get_duration_insec(s, val); av_log(s, AV_LOG_TRACE, "c->media_presentation_duration = [%"PRId64"]\n", c->media_presentation_duration); } attr = attr->next; @@ -1317,16 +1317,16 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) // at now we can handle only one period, with the longest duration node = xmlFirstElementChild(node); while (node) { - if (!av_strcasecmp(node->name, (const char *)"Period")) { + if (!av_strcasecmp(node->name, "Period")) { period_duration_sec = 0; period_start_sec = 0; attr = node->properties; while (attr) { val = xmlGetProp(node, attr->name); - if (!av_strcasecmp(attr->name, (const char *)"duration")) { - period_duration_sec = get_duration_insec(s, (const char *)val); - } else if (!av_strcasecmp(attr->name, (const char *)"start")) { - period_start_sec = get_duration_insec(s, (const char *)val); + if (!av_strcasecmp(attr->name, "duration")) { + period_duration_sec = get_duration_insec(s, val); + } else if (!av_strcasecmp(attr->name, "start")) { + period_start_sec = get_duration_insec(s, val); } attr = attr->next; xmlFree(val); @@ -1351,13 +1351,13 @@ static int parse_manifest(AVFormatContext *s, const char *url, AVIOContext *in) adaptionset_node = xmlFirstElementChild(period_node); while (adaptionset_node) { - if (!av_strcasecmp(adaptionset_node->name, (const char *)"BaseURL")) { + if (!av_strcasecmp(adaptionset_node->name, "BaseURL")) { period_baseurl_node = adaptionset_node; - } else if (!av_strcasecmp(adaptionset_node->name, (const char *)"SegmentTemplate")) { + } else if (!av_strcasecmp(adaptionset_node->name, "SegmentTemplate")) { period_segmenttemplate_node = adaptionset_node; - } else if (!av_strcasecmp(adaptionset_node->name, (const char *)"SegmentList")) { + } else if (!av_strcasecmp(adaptionset_node->name, "SegmentList")) { period_segmentlist_node = adaptionset_node; - } else if (!av_strcasecmp(adaptionset_node->name, (const char *)"AdaptationSet")) { + } else if (!av_strcasecmp(adaptionset_node->name, "AdaptationSet")) { parse_manifest_adaptationset(s, url, adaptionset_node, mpd_baseurl_node, period_baseurl_node, period_segmenttemplate_node, period_segmentlist_node); } adaptionset_node = xmlNextElementSibling(adaptionset_node);