+2007-10-16 Wim Taymans <wim.taymans@gmail.com>
+
+ * gst/playback/gstdecodebin.c: (new_pad), (type_found):
+ Make the window for a race in typefind and shutting down smaller until
+ we figure out the right locking here. Avoids #485753 usually.
+
+ * gst/playback/gstdecodebin2.c: (type_found), (pad_added_group_cb):
+ Remove unneeded lock causing a race in typefind and shutting down.
+ Fixes #485753.
+
+ * gst/playback/gstplaybin.c: (gst_play_bin_change_state):
+ Also remove sinks when going to NULL because we might not complete the
+ state change to PAUSED, causing the PAUSED->READY state change not to
+ happen.
+
2007-10-16 Wim Taymans <wim.taymans@gmail.com>
* gst-libs/gst/audio/gstbaseaudiosink.c:
shutting_down1:
{
+ GST_DEBUG_OBJECT (decode_bin, "we are shutting down");
GST_OBJECT_UNLOCK (decode_bin);
return;
}
shutting_down2:
{
+ GST_DEBUG_OBJECT (decode_bin, "we are shutting down");
GST_STATE_UNLOCK (decode_bin);
return;
}
gboolean dynamic;
GstPad *pad;
+ GST_DEBUG_OBJECT (decode_bin, "typefind found caps %" GST_PTR_FORMAT, caps);
+
+ GST_OBJECT_LOCK (decode_bin);
+ if (decode_bin->shutting_down)
+ goto shutting_down;
+ GST_OBJECT_UNLOCK (decode_bin);
+
GST_STATE_LOCK (decode_bin);
if (decode_bin->shutting_down)
goto exit;
decode_bin->have_type = TRUE;
- GST_DEBUG_OBJECT (decode_bin, "typefind found caps %" GST_PTR_FORMAT, caps);
-
/* special-case text/plain: we only want to accept it as a raw type if it
* comes from a subtitel parser element or a demuxer, but not if it is the
* type of the entire stream, in which case we just want to error out */
exit:
GST_STATE_UNLOCK (decode_bin);
return;
+
+shutting_down:
+ {
+ GST_DEBUG_OBJECT (decode_bin, "we are shutting down");
+ GST_OBJECT_UNLOCK (decode_bin);
+ return;
+ }
}
static void
{
GstPad *pad;
- GST_STATE_LOCK (decode_bin);
-
GST_DEBUG_OBJECT (decode_bin, "typefind found caps %" GST_PTR_FORMAT, caps);
/* we can only deal with one type, we don't yet support dynamically changing
gst_object_unref (pad);
exit:
- GST_STATE_UNLOCK (decode_bin);
return;
}
if (group->nbdynamic == 0)
expose = TRUE;
GROUP_MUTEX_UNLOCK (group);
+
if (expose) {
GST_LOG
("That was the last dynamic object, now attempting to expose the group");
/* FIXME Release audio device when we implement that */
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
+ case GST_STATE_CHANGE_READY_TO_NULL:
/* remove sinks we added */
remove_sinks (play_bin);
/* and there might be a fakesink we need to clean up now */