From 1c0c6b6f48369b4b01e81c82c7ecdefcb59c04aa Mon Sep 17 00:00:00 2001 From: David Waring Date: Wed, 10 Dec 2014 09:24:17 +0000 Subject: [PATCH] dashdemux: Change period when setting by period id. Make gst_mpd_client_set_period_id set the current period index when it finds a period with a matching period id. https://bugzilla.gnome.org/show_bug.cgi?id=741322 --- ext/dash/gstmpdparser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index 8a4b5c897d..80da32b7d2 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -3845,17 +3845,20 @@ gst_mpd_client_set_period_id (GstMpdClient * client, const gchar * period_id) GstStreamPeriod *next_stream_period; gboolean ret = FALSE; GList *iter; + guint period_idx; g_return_val_if_fail (client != NULL, FALSE); g_return_val_if_fail (client->periods != NULL, FALSE); g_return_val_if_fail (period_id != NULL, FALSE); - for (iter = client->periods; iter; iter = g_list_next (iter)) { + for (period_idx = 0, iter = client->periods; iter; + period_idx++, iter = g_list_next (iter)) { next_stream_period = iter->data; if (next_stream_period->period->id && strcmp (next_stream_period->period->id, period_id) == 0) { ret = TRUE; + client->period_idx = period_idx; break; } }