GNOME Bugzilla – Bug 772855
decodebin3: Implement lock for multiqueue slot
Last modified: 2016-10-31 14:35:31 UTC
decodebin3: Implement lock for multiqueue slot Since there can be multiple parsebin in a decodebin3, MultiQueueSlot should be protected by lock
Created attachment 337587 [details] [review] decodebin3-Remove-trailing-whitespace
Created attachment 337588 [details] [review] decodebin3-Implement-lock-for-multiqueue-slot
Created attachment 337596 [details] [LOG] Unexpected eos event (to multiqueue)
List of MultiQueueSlot (i.e., slots in decodebin3) and MultiQueueSlot itself should be protected by lock. There is a timing issue due to access to them without protection. Please refer to the attached log. When the problem happened, - output buffer of "parsebin1" was detected first (thread 0x8c400), 581 0:00:05.997468753 16257 0x8c400 FIXME decodebin3 gstdecodebin3-parse.c:396:parsebin_buffer_probe:<decodebin3-0> Need a lock ! 582 0:00:05.997525669 16257 0x8c400 DEBUG decodebin3 gstdecodebin3-parse.c:398:parsebin_buffer_probe:<parsebin1:src_0> Got a buffer ! UNBLOCK - then, buffer of "parsebin0" (thread 0x8c800) 613 0:00:06.006743253 16257 0x8c800 FIXME decodebin3 gstdecodebin3-parse.c:396:parsebin_buffer_probe:<decodebin3-0> Need a lock ! 614 0:00:06.006764128 16257 0x8c800 DEBUG decodebin3 gstdecodebin3-parse.c:398:parsebin_buffer_probe:<parsebin0:src_0> Got a buffer ! UNBLOCK ! - however, linking between "parsebin0" and multiqueue was done before that of "parsebin1", and it caused erroneous EOS event to multiqueue. 634 0:00:06.008808836 16257 0x8c800 INFO GST_PADS gstpad.c:2498:gst_pad_link_full: linked parsebin0:src_0 and multiqueue0:sink_1, successful 637 0:00:06.010344211 16257 0x8c800 DEBUG decodebin3 gstdecodebin3-parse.c:471:parsebin_buffer_probe:<multiqueue0:sink_0> Sending EOS to unused slot 638 0:00:06.007188878 16257 0x8c400 INFO GST_PADS gstpad.c:2498:gst_pad_link_full: linked parsebin1:src_0 and multiqueue0:sink_0, successful
Created attachment 337677 [details] [review] decodebin3-More-SELECTION_LOCK-when-linking-to-slot protecting a MultiQueueSlot may not be mandatory now..... I made change to protect slots by taking SELECTION_LOCK
Created attachment 337678 [details] [review] decodebin3-Implement-lock-for-multiqueue-slot
Indeed, iterating the slot list is already protected by the SELECTION lock (directly or implicitely) in the rest of decodebin3 code. Thanks for that ! commit 5f2c0c8ea72e3376ff0d8367a92f8bb900f5a19b Author: Seungha Yang <sh.yang@lge.com> Date: Thu Oct 13 20:10:09 2016 +0900 decodebin3: More SELECTION_LOCK when linking to slot Since there can be multiple parsebin in a decodebin3, linking parsebin with MultiQueueSlot should be protected also. https://bugzilla.gnome.org/show_bug.cgi?id=772855