player: Don't try to cache the GQuark for GST_PLAYER_ERROR
authorArun Raghavan <arun@osg.samsung.com>
Thu, 8 Dec 2016 05:52:38 +0000 (11:22 +0530)
committerArun Raghavan <arun@arunraghavan.net>
Thu, 8 Dec 2016 05:52:38 +0000 (11:22 +0530)
This is potentially racy (in the unlikely scenario that we get two
first-time calls to gst_player_error_quark() at the same time). This
should not impact anything in terms of performance since it's only on
the error path.

The call itself could just be inlined by making GST_PLAYER_ERROR be
defined to the g_quark_from_static_string() call, but this feels ugly
from an API perspective.

gst-libs/gst/player/gstplayer.c

index f92f09e..cac55cb 100644 (file)
@@ -70,12 +70,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_player_debug);
 GQuark
 gst_player_error_quark (void)
 {
-  static GQuark quark;
-
-  if (!quark)
-    quark = g_quark_from_static_string ("gst-player-error-quark");
-
-  return quark;
+  return g_quark_from_static_string ("gst-player-error-quark");
 }
 
 static GQuark QUARK_CONFIG;