From 19d604e92f621401c00bef46381866dde0d5b08b Mon Sep 17 00:00:00 2001 From: Florin Apostol Date: Mon, 2 Nov 2015 11:17:29 +0000 Subject: [PATCH] dashdemux: remove unreachable code The stream->cur_seg_template is set to the lowest available segment template (representation or adaptation or period, in this order). Because the template elements are inherited, the lowest template will have all the elements the parents had, so there is no need to check the parent for an element that is not found in the child (eg initialisation or index). https://bugzilla.gnome.org/show_bug.cgi?id=752714 --- ext/dash/gstmpdparser.c | 42 +++++++++++------------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index 7b5c876..783d777 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -5290,22 +5290,12 @@ gst_mpd_client_get_next_header (GstMpdClient * client, gchar ** uri, *range_start = 0; *range_end = stream->cur_segment_base->indexRange->first_byte_pos - 1; } - } else if (stream->cur_seg_template) { - const gchar *initialization = NULL; - if (stream->cur_seg_template->initialization) { - initialization = stream->cur_seg_template->initialization; - } else if (stream->cur_adapt_set->SegmentTemplate - && stream->cur_adapt_set->SegmentTemplate->initialization) { - initialization = stream->cur_adapt_set->SegmentTemplate->initialization; - } else if (stream_period->period->SegmentTemplate - && stream_period->period->SegmentTemplate->initialization) { - initialization = stream_period->period->SegmentTemplate->initialization; - } - if (initialization) { - *uri = gst_mpdparser_build_URL_from_template (initialization, - stream->cur_representation->id, 0, - stream->cur_representation->bandwidth, 0); - } + } else if (stream->cur_seg_template + && stream->cur_seg_template->initialization) { + *uri = + gst_mpdparser_build_URL_from_template (stream-> + cur_seg_template->initialization, stream->cur_representation->id, 0, + stream->cur_representation->bandwidth, 0); } return *uri == NULL ? FALSE : TRUE; @@ -5336,21 +5326,11 @@ gst_mpd_client_get_next_header_index (GstMpdClient * client, gchar ** uri, stream->cur_segment_base->Initialization)); *range_start = stream->cur_segment_base->indexRange->first_byte_pos; *range_end = stream->cur_segment_base->indexRange->last_byte_pos; - } else if (stream->cur_seg_template) { - const gchar *initialization = NULL; - if (stream->cur_seg_template->index) { - initialization = stream->cur_seg_template->index; - } else if (stream->cur_adapt_set->SegmentTemplate - && stream->cur_adapt_set->SegmentTemplate->index) { - initialization = stream->cur_adapt_set->SegmentTemplate->index; - } else if (stream_period->period->SegmentTemplate - && stream_period->period->SegmentTemplate->index) { - initialization = stream_period->period->SegmentTemplate->index; - } - if (initialization) - *uri = gst_mpdparser_build_URL_from_template (initialization, - stream->cur_representation->id, 0, - stream->cur_representation->bandwidth, 0); + } else if (stream->cur_seg_template && stream->cur_seg_template->index) { + *uri = + gst_mpdparser_build_URL_from_template (stream->cur_seg_template->index, + stream->cur_representation->id, 0, + stream->cur_representation->bandwidth, 0); } return *uri == NULL ? FALSE : TRUE; -- 2.7.4