mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 18:22:23 +00:00
bin: Always forward clock-lost message if we're not a top-level bin
This makes sure that no bin misses the clock-lost messages, independent of the state, and could return an old, non-working clock from gst_bin_provide_clock_func(). https://bugzilla.gnome.org/show_bug.cgi?id=701997
This commit is contained in:
parent
c8cfaff1ff
commit
ba4ec10aa5
1 changed files with 7 additions and 3 deletions
10
gst/gstbin.c
10
gst/gstbin.c
|
@ -3440,7 +3440,7 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message)
|
||||||
{
|
{
|
||||||
GstClock **provided_clock_p;
|
GstClock **provided_clock_p;
|
||||||
GstElement **clock_provider_p;
|
GstElement **clock_provider_p;
|
||||||
gboolean playing, provided, forward;
|
gboolean playing, toplevel, provided, forward;
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
|
|
||||||
gst_message_parse_clock_lost (message, &clock);
|
gst_message_parse_clock_lost (message, &clock);
|
||||||
|
@ -3448,10 +3448,14 @@ gst_bin_handle_message_func (GstBin * bin, GstMessage * message)
|
||||||
GST_OBJECT_LOCK (bin);
|
GST_OBJECT_LOCK (bin);
|
||||||
bin->clock_dirty = TRUE;
|
bin->clock_dirty = TRUE;
|
||||||
/* if we lost the clock that we provided, post to parent but
|
/* if we lost the clock that we provided, post to parent but
|
||||||
* only if we are PLAYING. */
|
* only if we are not a top-level bin or PLAYING.
|
||||||
|
* The reason for this is that applications should be able
|
||||||
|
* to PAUSE/PLAY if they receive this message without worrying
|
||||||
|
* about the state of the pipeline. */
|
||||||
provided = (clock == bin->provided_clock);
|
provided = (clock == bin->provided_clock);
|
||||||
playing = (GST_STATE (bin) == GST_STATE_PLAYING);
|
playing = (GST_STATE (bin) == GST_STATE_PLAYING);
|
||||||
forward = playing & provided;
|
toplevel = GST_OBJECT_PARENT (bin) == NULL;
|
||||||
|
forward = provided && (playing || !toplevel);
|
||||||
if (provided) {
|
if (provided) {
|
||||||
GST_DEBUG_OBJECT (bin,
|
GST_DEBUG_OBJECT (bin,
|
||||||
"Lost clock %" GST_PTR_FORMAT " provided by %" GST_PTR_FORMAT,
|
"Lost clock %" GST_PTR_FORMAT " provided by %" GST_PTR_FORMAT,
|
||||||
|
|
Loading…
Reference in a new issue