From: Eunhye Choi Date: Thu, 23 Jan 2025 07:40:04 +0000 (+0900) Subject: urisourcebin: fix deadlock X-Git-Tag: accepted/tizen/unified/20250124.043544^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc53c525c00574fec7beb027e9bcfd407e2da9ba;p=platform%2Fupstream%2Fgstreamer.git urisourcebin: fix deadlock [Vesrion] 1.24.11-1 [Issue] - deadlock is occurred during autoplugging between setting state thread and typefind sinkpad activation thread. - need to get parsebin state lock before adding it to urisourcebin which is under changing state too. Change-Id: I5a15c60f48c2db2197ae20ce971a1e3d995b0ac9 --- diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index c8e99ad1a7..21adea8159 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -60,7 +60,7 @@ Name: %{_name} Version: 1.24.11 -Release: 0 +Release: 1 Summary: Streaming-Media Framework Runtime License: LGPL-2.0+ Group: Multimedia/Framework diff --git a/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c b/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c index 189e388b19..a1814df10f 100644 --- a/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c +++ b/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c @@ -2133,6 +2133,9 @@ setup_parsebin_for_slot (ChildSrcPadInfo * info, GstPad * originating_pad) return FALSE; #endif } +#ifdef TIZEN_FEATURE_URISRCBIN_FIX_DEADLOCK + GST_STATE_LOCK(info->demuxer); +#endif gst_bin_add (GST_BIN_CAST (urisrc), info->demuxer); info->demuxer_is_parsebin = TRUE; @@ -2161,11 +2164,18 @@ setup_parsebin_for_slot (ChildSrcPadInfo * info, GstPad * originating_pad) gst_element_sync_state_with_parent (info->pre_parse_queue); } gst_element_sync_state_with_parent (info->demuxer); +#ifdef TIZEN_FEATURE_URISRCBIN_FIX_DEADLOCK + GST_STATE_UNLOCK(info->demuxer); +#endif GST_URI_SOURCE_BIN_UNLOCK (urisrc); return TRUE; could_not_link: { +#ifdef TIZEN_FEATURE_URISRCBIN_FIX_DEADLOCK + if (info->demuxer) + GST_STATE_UNLOCK(info->demuxer); +#endif GST_URI_SOURCE_BIN_UNLOCK (urisrc); GST_ELEMENT_ERROR (urisrc, CORE, NEGOTIATION, (NULL), ("Can't link to (pre-)parsebin element")); diff --git a/subprojects/gst-plugins-base/meson.build b/subprojects/gst-plugins-base/meson.build index 325d085c36..a454537fd5 100644 --- a/subprojects/gst-plugins-base/meson.build +++ b/subprojects/gst-plugins-base/meson.build @@ -408,6 +408,7 @@ core_conf.set('TIZEN_FEATURE_DISABLE_EOS_DROP', true) core_conf.set('TIZEN_FEATURE_MANUAL_BUFFERING_CTRL', true) core_conf.set('TIZEN_FEATURE_FIX_PAD_BLOCK', true) core_conf.set('TIZEN_FEATURE_BUG_FIX', true) +core_conf.set('TIZEN_FEATURE_URISRCBIN_FIX_DEADLOCK', true) tbm_dep = dependency('libtbm', required : get_option('tbm')) if tbm_dep.found()