diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-07-09 17:15:55 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-07-16 17:40:45 +0200 |
commit | ed271ff809c193ce3a3c6a89a0bdec4aedc52391 (patch) | |
tree | f2831b73c05f3aed823ad0824b26bf4f577a4c9b | |
parent | e84c7f02b4a8ff402c463ee5175cd4c4d78dcbd3 (diff) |
baseaudiosink: Post clock-provide and clock-lost messages when going from/to PLAYING
-rw-r--r-- | gst-libs/gst/audio/gstbaseaudiosink.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index 5aec9f63a..76efba9a1 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -1849,8 +1849,28 @@ gst_base_audio_sink_change_state (GstElement * element, /* sync rendering on eos needs running clock */ gst_ring_buffer_start (sink->ringbuffer); } + + /* Only post clock-provide messages if this is the clock that + * we've created. If the subclass has overriden it the subclass + * should post this messages whenever necessary */ + if (sink->provided_clock && GST_IS_AUDIO_CLOCK (sink->provided_clock) && + GST_AUDIO_CLOCK_CAST (sink->provided_clock)->func == + (GstAudioClockGetTimeFunc) gst_base_audio_sink_get_time) + gst_element_post_message (element, + gst_message_new_clock_provide (GST_OBJECT_CAST (element), + sink->provided_clock, TRUE)); break; case GST_STATE_CHANGE_PLAYING_TO_PAUSED: + /* Only post clock-lost messages if this is the clock that + * we've created. If the subclass has overriden it the subclass + * should post this messages whenever necessary */ + if (sink->provided_clock && GST_IS_AUDIO_CLOCK (sink->provided_clock) && + GST_AUDIO_CLOCK_CAST (sink->provided_clock)->func == + (GstAudioClockGetTimeFunc) gst_base_audio_sink_get_time) + gst_element_post_message (element, + gst_message_new_clock_lost (GST_OBJECT_CAST (element), + sink->provided_clock)); + /* ringbuffer cannot start anymore */ gst_ring_buffer_may_start (sink->ringbuffer, FALSE); gst_ring_buffer_pause (sink->ringbuffer); |