mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
[MOVED FROM GST-P-FARSIGHT] Have the liveadder remember if its playing or not
20080514234948-3e2dc-9064a27a54aef598444aa6ad6463345979120828.gz
This commit is contained in:
parent
75edc07516
commit
703b3326cc
2 changed files with 24 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,6 +92,8 @@ struct _GstLiveAdder {
|
|||
GstClockTime peer_latency;
|
||||
|
||||
gboolean segment_pending;
|
||||
|
||||
gboolean playing;
|
||||
};
|
||||
|
||||
struct _GstLiveAdderClass {
|
||||
|
|
Loading…
Reference in a new issue