gst1: Replace playbin-stream-changed with Gst.MessageType.STREAM_START

This commit is contained in:
Stein Magnus Jodal 2015-11-23 00:10:39 +01:00
parent 13567d271a
commit 3e4bd16be2

View File

@ -255,16 +255,12 @@ class _Handler(object):
elif msg.type == Gst.MessageType.ELEMENT:
if GstPbutils.is_missing_plugin_message(msg):
self.on_missing_plugin(msg)
elif msg.type == Gst.MessageType.STREAM_START:
self.on_stream_changed(self._audio._playbin.get_property('uri'))
def on_event(self, pad, event):
if event.type == Gst.EventType.SEGMENT:
self.on_new_segment(event.parse_new_segment())
elif event.type == Gst.EventType.SINK_MESSAGE:
# Handle stream changed messages when they reach our output bin.
# If we listen for it on the bus we get one per tee branch.
msg = event.parse_sink_message()
if msg.get_structure().has_name('playbin-stream-changed'):
self.on_stream_changed(msg.get_structure().get_string('uri'))
return True
def on_playbin_state_changed(self, old_state, new_state, pending_state):