diff options
author | Olivier Crete <olivier.crete@collabora.co.uk> | 2008-05-14 23:49:48 +0000 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2009-02-17 19:29:05 +0100 |
commit | 703b3326cc252dcbb7656d01cad06751a29d496b (patch) | |
tree | 1ed15b5f452c3ef4ceb286f45e7b4a3b67e436f7 /gst/liveadder | |
parent | 75edc07516b78309dc10f6419411f5db1b7f17a9 (diff) |
[MOVED FROM GST-P-FARSIGHT] Have the liveadder remember if its playing or not
Diffstat (limited to 'gst/liveadder')
-rw-r--r-- | gst/liveadder/liveadder.c | 31 | ||||
-rw-r--r-- | gst/liveadder/liveadder.h | 2 |
2 files changed, 24 insertions, 9 deletions
diff --git a/gst/liveadder/liveadder.c b/gst/liveadder/liveadder.c index 592037691..f59415c7a 100644 --- a/gst/liveadder/liveadder.c +++ b/gst/liveadder/liveadder.c @@ -1366,21 +1366,34 @@ gst_live_adder_change_state (GstElement * element, GstStateChange transition) switch (transition) { case GST_STATE_CHANGE_READY_TO_PAUSED: - { - GST_OBJECT_LOCK (adder); - adder->segment_pending = TRUE; - adder->peer_latency = 0; - adder->next_timestamp = GST_CLOCK_TIME_NONE; - g_list_foreach (adder->sinkpads, (GFunc) reset_pad_private, NULL); - GST_OBJECT_UNLOCK (adder); - break; - } + GST_OBJECT_LOCK (adder); + adder->segment_pending = TRUE; + adder->peer_latency = 0; + adder->next_timestamp = GST_CLOCK_TIME_NONE; + g_list_foreach (adder->sinkpads, (GFunc) reset_pad_private, NULL); + GST_OBJECT_UNLOCK (adder); + break; + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: + GST_OBJECT_LOCK (adder); + adder->playing = FALSE; + GST_OBJECT_UNLOCK (adder); + break; default: break; } ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + switch (transition) { + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: + GST_OBJECT_LOCK (adder); + adder->playing = TRUE; + GST_OBJECT_UNLOCK (adder); + break; + default: + break; + } + return ret; } diff --git a/gst/liveadder/liveadder.h b/gst/liveadder/liveadder.h index 0ad93e546..564ff370a 100644 --- a/gst/liveadder/liveadder.h +++ b/gst/liveadder/liveadder.h @@ -92,6 +92,8 @@ struct _GstLiveAdder { GstClockTime peer_latency; gboolean segment_pending; + + gboolean playing; }; struct _GstLiveAdderClass { |