kate: fix race condition on PAUSED->READY state change

https://bugzilla.gnome.org/show_bug.cgi?id=660630
This commit is contained in:
Vincent Penquerc'h 2011-10-01 14:30:07 +01:00 committed by Sebastian Dröge
parent 46dd7941f3
commit 12bb47343d

View file

@ -571,6 +571,12 @@ gst_kate_tiger_kate_chain (GstPad * pad, GstBuffer * buf)
GST_LOG_OBJECT (tiger, "Got kate buffer, caps %" GST_PTR_FORMAT, GST_LOG_OBJECT (tiger, "Got kate buffer, caps %" GST_PTR_FORMAT,
GST_BUFFER_CAPS (buf)); GST_BUFFER_CAPS (buf));
/* Now that we have the lock, check if we're flushing */
if (tiger->decoder.kate_flushing) {
GST_DEBUG_OBJECT (tiger, "Flushing, disregarding buffer");
goto done;
}
/* Unfortunately, it can happen that the start of the stream is not sent, /* Unfortunately, it can happen that the start of the stream is not sent,
for instance if there's a stream selector upstream, which is switched for instance if there's a stream selector upstream, which is switched
from another Kate stream. If this happens, then we can fallback on the from another Kate stream. If this happens, then we can fallback on the
@ -663,6 +669,7 @@ gst_kate_tiger_kate_chain (GstPad * pad, GstBuffer * buf)
} }
} }
done:
GST_KATE_TIGER_MUTEX_UNLOCK (tiger); GST_KATE_TIGER_MUTEX_UNLOCK (tiger);
gst_object_unref (tiger); gst_object_unref (tiger);