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
This commit is contained in:
David Waring 2014-12-10 09:24:17 +00:00 committed by Thiago Santos
parent 8b63a16af0
commit 1c0c6b6f48

View file

@ -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;
}
}