decodebin2: Don't let thread run after unref
authorEdward Hervey <edward@centricular.com>
Fri, 10 Nov 2017 13:54:12 +0000 (14:54 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 10 Nov 2017 16:06:10 +0000 (17:06 +0100)
commit43b9bcbddb6599fe05c1fafa3105412fedd07d23
tree413df2595b77d0cdf8c7e6fcdb9f66000e01b8b0
parentd53ccfd8e51065d0f8895f959b132e1fb7843429
decodebin2: Don't let thread run after unref

We have a dedicated one-shot thread to handle cleanup of old groups.

While this is a good idea. It's an even better idea to make sure
that thread is *completed* before the decodebin2 element to which
it is related isn't freed/gone.

* There can only be one cleanup thread happening at any point in time.
  If there is already one, we wait for the previous one to finish.
* When shutting down (NULL=>READY) make sure the thread is finished

https://bugzilla.gnome.org/show_bug.cgi?id=790007
gst/playback/gstdecodebin2.c