summaryrefslogtreecommitdiff
path: root/gst/playback
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2016-01-15 09:50:29 +0100
committerEdward Hervey <bilboed@bilboed.com>2016-01-15 10:05:58 +0100
commit62053852de01fb324a915b27c00f5b8dc0f66fb3 (patch)
treec30fc4a93c9a13e088f62ccb6e33e50ad7634688 /gst/playback
parentbc90841c7d069fcdb0e6d681f1cbf8a326e080f3 (diff)
downloadgstreamer-plugins-base-62053852de01fb324a915b27c00f5b8dc0f66fb3.tar.gz
playsink: Properly mark pending blocked pads
When blocking input pads, we also need to properly set the appropriate pending flag. Without this, when switching stream types after initial configuration (like going from Audio+Video to Audio+Video+Sub) playsink would never wait for *all* input streams to be blocked (it would just wait for the new input pad (text in this case) to be blocked). Since the reconfiguration might introduce unlinking/relinking of elements, we need to ensure that *ALL* input streams are blocked. Failure to do so would result in having some input streams pushing data to inactive elements (returning GST_FLOW_FLUSHING) or unlinked pads (returning GST_FLOW_NOT_LINKED). A later optimization could involve only blocking the input pads that might be involved in reconfiguration. But better be safe than sorry for now :)
Diffstat (limited to 'gst/playback')
-rw-r--r--gst/playback/gstplaysink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
index e126d1808..202de926c 100644
--- a/gst/playback/gstplaysink.c
+++ b/gst/playback/gstplaysink.c
@@ -4155,7 +4155,7 @@ video_set_blocked (GstPlaySink * playsink, gboolean blocked)
gst_pad_remove_probe (((GstPlayVisChain *) playsink->vischain)->
blockpad, playsink->vis_pad_block_id);
playsink->vis_pad_block_id = 0;
-
+ PENDING_FLAG_SET (playsink, GST_PLAY_SINK_TYPE_VIDEO);
playsink->video_block_id =
gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
sinkpad_blocked_cb, playsink, NULL);
@@ -4183,6 +4183,7 @@ audio_set_blocked (GstPlaySink * playsink, gboolean blocked)
blockpad, playsink->vis_pad_block_id);
playsink->vis_pad_block_id = 0;
+ PENDING_FLAG_SET (playsink, GST_PLAY_SINK_TYPE_AUDIO);
playsink->audio_block_id =
gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
sinkpad_blocked_cb, playsink, NULL);
@@ -4215,6 +4216,7 @@ text_set_blocked (GstPlaySink * playsink, gboolean blocked)
blockpad, playsink->vis_pad_block_id);
playsink->vis_pad_block_id = 0;
+ PENDING_FLAG_SET (playsink, GST_PLAY_SINK_TYPE_TEXT);
playsink->text_block_id =
gst_pad_add_probe (opad, GST_PAD_PROBE_TYPE_BLOCK_DOWNSTREAM,
sinkpad_blocked_cb, playsink, NULL);