mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-08 00:18:54 +00:00
streamsynchronizer: If a stream belongs to an already running stream, don't wait
This fixes enabling visualizations after the audio stream already started. https://bugzilla.gnome.org/show_bug.cgi?id=697820
This commit is contained in:
parent
93769b1a60
commit
2e017bd595
1 changed files with 58 additions and 36 deletions
|
@ -241,20 +241,39 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_STREAM_START:
|
case GST_EVENT_STREAM_START:
|
||||||
{
|
{
|
||||||
GstStream *stream;
|
GstStream *stream, *ostream;
|
||||||
guint32 seqnum = gst_event_get_seqnum (event);
|
guint32 seqnum = gst_event_get_seqnum (event);
|
||||||
GList *l;
|
GList *l;
|
||||||
gboolean all_wait = TRUE;
|
gboolean all_wait = TRUE;
|
||||||
|
gboolean new_stream = TRUE;
|
||||||
|
|
||||||
GST_STREAM_SYNCHRONIZER_LOCK (self);
|
GST_STREAM_SYNCHRONIZER_LOCK (self);
|
||||||
stream = gst_pad_get_element_private (pad);
|
stream = gst_pad_get_element_private (pad);
|
||||||
if (stream && stream->stream_start_seqnum != seqnum) {
|
if (stream && stream->stream_start_seqnum != seqnum) {
|
||||||
|
stream->is_eos = FALSE;
|
||||||
|
stream->new_stream = TRUE;
|
||||||
|
stream->stream_start_seqnum = seqnum;
|
||||||
|
|
||||||
|
/* Check if this belongs to a stream that is already there,
|
||||||
|
* e.g. we got the visualizations for an audio stream */
|
||||||
|
for (l = self->streams; l; l = l->next) {
|
||||||
|
ostream = l->data;
|
||||||
|
|
||||||
|
if (ostream->stream_start_seqnum == seqnum && !ostream->wait) {
|
||||||
|
new_stream = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!new_stream) {
|
||||||
|
GST_DEBUG_OBJECT (pad,
|
||||||
|
"Stream %d belongs to running stream %d, no waiting",
|
||||||
|
stream->stream_number, ostream->stream_number);
|
||||||
|
stream->wait = FALSE;
|
||||||
|
} else {
|
||||||
GST_DEBUG_OBJECT (pad, "Stream %d changed", stream->stream_number);
|
GST_DEBUG_OBJECT (pad, "Stream %d changed", stream->stream_number);
|
||||||
|
|
||||||
stream->is_eos = FALSE;
|
|
||||||
stream->wait = TRUE;
|
stream->wait = TRUE;
|
||||||
stream->new_stream = TRUE;
|
|
||||||
|
|
||||||
for (l = self->streams; l; l = l->next) {
|
for (l = self->streams; l; l = l->next) {
|
||||||
GstStream *ostream = l->data;
|
GstStream *ostream = l->data;
|
||||||
|
@ -298,11 +317,14 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
|
||||||
g_cond_broadcast (&ostream->stream_finish_cond);
|
g_cond_broadcast (&ostream->stream_finish_cond);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
|
||||||
GST_DEBUG_OBJECT (self, "No stream or STREAM_START from same source");
|
|
||||||
GST_STREAM_SYNCHRONIZER_UNLOCK (self);
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
GST_DEBUG_OBJECT (self, "No stream or STREAM_START from same source");
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_STREAM_SYNCHRONIZER_UNLOCK (self);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case GST_EVENT_SEGMENT:{
|
case GST_EVENT_SEGMENT:{
|
||||||
GstStream *stream;
|
GstStream *stream;
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
|
|
Loading…
Reference in a new issue