hlsdemux: m3u8: protect public methods properly
authorAndoni Morales Alastruey <ylatuya@gmail.com>
Sat, 12 Mar 2011 11:28:42 +0000 (12:28 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 30 Mar 2011 07:19:23 +0000 (09:19 +0200)
gst/hls/m3u8.c
gst/hls/m3u8.h

index 5ad06052b22f4220353d0a3ea232de4d6aeb2e62..0b702122982bde8d17520df42ed2f426d014d9fd 100644 (file)
@@ -471,3 +471,30 @@ gst_m3u8_client_get_duration (GstM3U8Client * client)
   g_list_foreach (client->current->files, (GFunc) _sum_duration, &duration);
   return duration;
 }
+
+const gchar *
+gst_m3u8_client_get_uri (GstM3U8Client * client)
+{
+  g_return_val_if_fail (client != NULL, NULL);
+
+  return client->main->uri;
+}
+
+gboolean
+gst_m3u8_client_has_variant_playlist (GstM3U8Client * client)
+{
+  g_return_val_if_fail (client != NULL, FALSE);
+
+  return client->main->lists != NULL;
+}
+
+gboolean
+gst_m3u8_client_is_live (GstM3U8Client * client)
+{
+  g_return_val_if_fail (client != NULL, FALSE);
+
+  if (!client->current || client->current->endlist)
+    return FALSE;
+
+  return TRUE;
+}
index 499aa52551cbecc73d75bbed0cb038518f459026..f19050c327463799726e239f00193636027f0422 100644 (file)
@@ -78,9 +78,9 @@ 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)
+const gchar *gst_m3u8_client_get_uri(GstM3U8Client * client);
+gboolean gst_m3u8_client_has_variant_playlist(GstM3U8Client * client);
+gboolean gst_m3u8_client_is_live(GstM3U8Client * client);
 
 G_END_DECLS
 #endif /* __M3U8_H__ */