return file->uri;
}
+
+static void
+_sum_duration (GstM3U8MediaFile * self, GstClockTime * duration)
+{
+ *duration += self->duration;
+}
+
+GstClockTime
+gst_m3u8_client_get_duration (GstM3U8Client * client)
+{
+ GstClockTime duration = 0;
+
+ g_return_val_if_fail (client != NULL, GST_CLOCK_TIME_NONE);
+
+ /* We can only get the duration for on-demand streams */
+ if (!client->current->endlist)
+ return GST_CLOCK_TIME_NONE;
+
+ g_list_foreach (client->current->files, (GFunc) _sum_duration, &duration);
+ return duration;
+}
void gst_m3u8_client_set_current (GstM3U8Client * client, GstM3U8 * m3u8);
const gchar *gst_m3u8_client_get_next_fragment (GstM3U8Client * client,
gboolean * discontinuity);
+GstClockTime gst_m3u8_client_get_duration (GstM3U8Client * client);
#define gst_m3u8_client_get_uri(Client) ((Client)->main->uri)
#define gst_m3u8_client_has_variant_playlist(Client) ((Client)->main->lists)
#define gst_m3u8_client_is_live(Client) (!(Client)->main->lists && !(Client)->current->endlist)