queue/queue2: Ensure that the streaming thread is unlocked after deactivating the srcpad

It might happen that the srcpad task function is never called at all, in
which case unlocking everything from there will never happen.

Make sure to unlock everything another time after the task function is
definitely stopped.

https://bugzilla.gnome.org/show_bug.cgi?id=776039
This commit is contained in:
Sebastian Dröge 2016-12-13 20:00:55 +02:00
parent 66f46a0df1
commit ed57611c4f
2 changed files with 8 additions and 0 deletions

View file

@ -1729,6 +1729,10 @@ gst_queue_src_activate_mode (GstPad * pad, GstObject * parent, GstPadMode mode,
/* step 2, make sure streaming finishes */ /* step 2, make sure streaming finishes */
result = gst_pad_stop_task (pad); result = gst_pad_stop_task (pad);
GST_QUEUE_MUTEX_LOCK (queue);
gst_queue_locked_flush (queue, FALSE);
GST_QUEUE_MUTEX_UNLOCK (queue);
} }
break; break;
default: default:

View file

@ -3509,6 +3509,10 @@ gst_queue2_src_activate_push (GstPad * pad, GstObject * parent, gboolean active)
/* step 2, make sure streaming finishes */ /* step 2, make sure streaming finishes */
result = gst_pad_stop_task (pad); result = gst_pad_stop_task (pad);
GST_QUEUE2_MUTEX_LOCK (queue);
gst_queue2_locked_flush (queue, FALSE, FALSE);
GST_QUEUE2_MUTEX_UNLOCK (queue);
} }
return result; return result;