hlsdemux: post a message in the bus when the playlist changes
authorAndoni Morales Alastruey <ylatuya@gmail.com>
Sat, 12 Mar 2011 12:32:57 +0000 (13:32 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 30 Mar 2011 07:19:23 +0000 (09:19 +0200)
gst/hls/gsthlsdemux.c

index b9235ec6a290e01a90fbc848c815b2589be8a933..4513ef0b1ea4cc5b2674a7ac7b902eddfb9fd50f 100644 (file)
@@ -849,6 +849,7 @@ static gboolean
 gst_hls_demux_change_playlist (GstHLSDemux * demux, gboolean is_fast)
 {
   GList *list;
+  GstStructure *s;
 
   if (is_fast)
     list = g_list_next (demux->client->main->lists);
@@ -866,6 +867,12 @@ gst_hls_demux_change_playlist (GstHLSDemux * demux, gboolean is_fast)
   GST_INFO_OBJECT (demux, "Client is %s, switching to bitrate %d",
       is_fast ? "fast" : "slow", demux->client->current->bandwidth);
 
+  s = gst_structure_new ("playlist",
+      "uri", G_TYPE_STRING, demux->client->current->uri,
+      "bitrate", G_TYPE_INT, demux->client->current->bandwidth, NULL);
+  gst_element_post_message (GST_ELEMENT_CAST (demux),
+      gst_message_new_element (GST_OBJECT_CAST (demux), s));
+
   return TRUE;
 }