gst-plugins-bad: hlsdemux: m3u8: protect public methods properly
Sebastian Dröge
slomo at kemper.freedesktop.org
Wed Mar 30 01:07:41 PDT 2011
Module: gst-plugins-bad
Branch: master
Commit: 18cd90e73f82d94c15767c3ffac2de5b1529c96e
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=18cd90e73f82d94c15767c3ffac2de5b1529c96e
Author: Andoni Morales Alastruey <ylatuya at gmail.com>
Date: Sat Mar 12 12:28:42 2011 +0100
hlsdemux: m3u8: protect public methods properly
---
gst/hls/m3u8.c | 27 +++++++++++++++++++++++++++
gst/hls/m3u8.h | 6 +++---
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/gst/hls/m3u8.c b/gst/hls/m3u8.c
index 5ad0605..0b70212 100644
--- a/gst/hls/m3u8.c
+++ b/gst/hls/m3u8.c
@@ -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;
+}
diff --git a/gst/hls/m3u8.h b/gst/hls/m3u8.h
index 499aa52..f19050c 100644
--- a/gst/hls/m3u8.h
+++ b/gst/hls/m3u8.h
@@ -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__ */
More information about the gstreamer-commits
mailing list