mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 04:00:37 +00:00
outputselector: Recheck pending switch after pushing buffer
This patch makes output-selector always recheck if there's a pending pad switch after pushing a buffer, preventing that it pushes a buffer on the 'wrong' pad. https://bugzilla.gnome.org/show_bug.cgi?id=629917
This commit is contained in:
parent
246bb32dc5
commit
974ca7713a
1 changed files with 12 additions and 1 deletions
|
@ -394,7 +394,18 @@ gst_output_selector_chain (GstPad * pad, GstBuffer * buf)
|
||||||
|
|
||||||
osel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
|
osel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
if (osel->pending_srcpad) {
|
/*
|
||||||
|
* The _switch function might push a buffer if 'resend-latest' is true.
|
||||||
|
*
|
||||||
|
* Elements/Applications (e.g. camerabin) might use pad probes to
|
||||||
|
* switch output-selector's active pad. If we simply switch and don't
|
||||||
|
* recheck any pending pad switch the following codepath could end
|
||||||
|
* up pushing a buffer on a non-active pad. This is bad.
|
||||||
|
*
|
||||||
|
* So we always should check the pending_srcpad before going further down
|
||||||
|
* the chain and pushing the new buffer
|
||||||
|
*/
|
||||||
|
while (osel->pending_srcpad) {
|
||||||
/* Do the switch */
|
/* Do the switch */
|
||||||
gst_output_selector_switch (osel);
|
gst_output_selector_switch (osel);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue