gst/playback/gstdecodebin2.c: Cast lock macro parameters to make sure we're actually accessing the lock member at the...

Original commit message from CVS:
* gst/playback/gstdecodebin2.c: (gst_decode_bin_dispose):
Cast lock macro parameters to make sure we're actually accessing the
lock member at the right class level. Free list itself in _dispose()
as well and NULL it in case dispose gets called multiple times.
This commit is contained in:
Tim-Philipp Müller 2007-01-25 14:29:21 +00:00
parent a8d29e1f82
commit af52900954
2 changed files with 12 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2007-01-25 Tim-Philipp Müller <tim at centricular dot net>
* gst/playback/gstdecodebin2.c: (gst_decode_bin_dispose):
Cast lock macro parameters to make sure we're actually accessing the
lock member at the right class level. Free list itself in _dispose()
as well and NULL it in case dispose gets called multiple times.
2007-01-25 Edward Hervey <edward@fluendo.com>
* gst/playback/gstdecodebin2.c:

View file

@ -54,6 +54,7 @@ typedef struct _GstDecodeBin GstDecodeBin;
typedef struct _GstDecodeBinClass GstDecodeBinClass;
#define GST_TYPE_DECODE_BIN (gst_decode_bin_get_type())
#define GST_DECODE_BIN_CAST(obj) ((GstDecodeBin*)(obj))
#define GST_DECODE_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DECODE_BIN,GstDecodeBin))
#define GST_DECODE_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DECODE_BIN,GstDecodeBinClass))
#define GST_IS_DECODE_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DECODE_BIN))
@ -146,7 +147,7 @@ static GstStateChangeReturn gst_decode_bin_change_state (GstElement * element,
GST_LOG_OBJECT (dbin, \
"locking from thread %p", \
g_thread_self ()); \
g_mutex_lock (dbin->lock); \
g_mutex_lock (GST_DECODE_BIN_CAST(dbin)->lock); \
GST_LOG_OBJECT (dbin, \
"locked from thread %p", \
g_thread_self ()); \
@ -156,7 +157,7 @@ static GstStateChangeReturn gst_decode_bin_change_state (GstElement * element,
GST_LOG_OBJECT (dbin, \
"unlocking from thread %p", \
g_thread_self ()); \
g_mutex_unlock (dbin->lock); \
g_mutex_unlock (GST_DECODE_BIN_CAST(dbin)->lock); \
} G_STMT_END
/* GstDecodeGroup
@ -481,8 +482,6 @@ gst_decode_bin_dispose (GObject * object)
gst_plugin_feature_list_free (decode_bin->factories);
decode_bin->factories = NULL;
/* FILLME */
if (decode_bin->activegroup) {
gst_decode_group_free (decode_bin->activegroup);
decode_bin->activegroup = NULL;
@ -494,6 +493,8 @@ gst_decode_bin_dispose (GObject * object)
gst_decode_group_free (group);
}
g_list_free (decode_bin->groups);
decode_bin->groups = NULL;
if (decode_bin->caps)
gst_caps_unref (decode_bin->caps);