summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7b469c4)
raw | patch | inline | side by side (parent: 7b469c4)
author | Andy Wingo <wingo@pobox.com> | |
Sun, 2 Oct 2005 23:24:25 +0000 (23:24 +0000) | ||
committer | Andy Wingo <wingo@pobox.com> | |
Sun, 2 Oct 2005 23:24:25 +0000 (23:24 +0000) |
Original commit message from CVS:
2005-10-03 Andy Wingo <wingo@pobox.com>
* gst/gstpad.c (gst_pad_activate_push): There is a race condition
whereby calling a pad's activatepush() function can start a thread
that starts to push or pull before the pad gets the FLUSHING flag
unset. Hack around it by holding the stream lock until the flag is
set. Need to replace this with a proper solution. Together with
the ghost pad fixes, this fixes mp3 playing/tagreading.
2005-10-03 Andy Wingo <wingo@pobox.com>
* gst/gstpad.c (gst_pad_activate_push): There is a race condition
whereby calling a pad's activatepush() function can start a thread
that starts to push or pull before the pad gets the FLUSHING flag
unset. Hack around it by holding the stream lock until the flag is
set. Need to replace this with a proper solution. Together with
the ghost pad fixes, this fixes mp3 playing/tagreading.
ChangeLog | patch | blob | history | |
gst/gstpad.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 337f3d0e5dc29afdd544a96b6b204070f3ba6a09..cb470c8d374afbb14415616723f5f933ff59c21d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
2005-10-03 Andy Wingo <wingo@pobox.com>
+ * gst/gstpad.c (gst_pad_activate_push): There is a race condition
+ whereby calling a pad's activatepush() function can start a thread
+ that starts to push or pull before the pad gets the FLUSHING flag
+ unset. Hack around it by holding the stream lock until the flag is
+ set. Need to replace this with a proper solution. Together with
+ the ghost pad fixes, this fixes mp3 playing/tagreading.
+
* docs/design/part-gstghostpad.txt: Add a note about activation of
proxy pads outside of ghost pads.
diff --git a/gst/gstpad.c b/gst/gstpad.c
index b7c5294714d73459bf6790c1f5bf8d1ab5473958..e7b6b6d8b7fc447886c46c178804bf41efea67d2 100644 (file)
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
GST_PAD_UNSET_FLUSHING (pad);
GST_UNLOCK (pad);
} else {
- /* make streaming stop */
+ /* ensures that streaming stops */
GST_STREAM_LOCK (pad);
GST_STREAM_UNLOCK (pad);
}
pre_activate_switch (pad, active);
+ /* terrible hack */
+ if (active)
+ GST_STREAM_LOCK (pad);
+
if (GST_PAD_ACTIVATEPUSHFUNC (pad)) {
if (GST_PAD_ACTIVATEPUSHFUNC (pad) (pad, active)) {
goto success;
GST_UNLOCK (pad);
post_activate_switch (pad, active);
+ /* terrible hack */
+ if (active)
+ GST_STREAM_UNLOCK (pad);
+
GST_CAT_DEBUG_OBJECT (GST_CAT_PADS, pad, "%s in push mode",
active ? "activated" : "deactivated");
return TRUE;
failure:
{
+ /* terrible hack */
+ if (active)
+ GST_STREAM_UNLOCK (pad);
+
GST_CAT_INFO_OBJECT (GST_CAT_PADS, pad, "failed to %s in push mode",
active ? "activate" : "deactivate");
return FALSE;