typefind: don't take object lock for reading the found caps

Once we switch to normal mode, we're not typefinding anymore and thus the caps
will not change. Therefore can avoid the object lock in the data-flow path.
The locking was added in order to fix bug #608877.
This commit is contained in:
Stefan Kost 2011-01-12 16:03:30 +02:00
parent 624168d8a0
commit c5a57190ee

View file

@ -765,10 +765,9 @@ gst_type_find_element_chain (GstPad * pad, GstBuffer * buffer)
/* we should already have called GST_ELEMENT_ERROR */
return GST_FLOW_ERROR;
case MODE_NORMAL:
GST_OBJECT_LOCK (typefind);
/* don't take object lock as typefind->caps should not change anymore */
buffer = gst_buffer_make_metadata_writable (buffer);
gst_buffer_set_caps (buffer, typefind->caps);
GST_OBJECT_UNLOCK (typefind);
return gst_pad_push (typefind->src, buffer);
case MODE_TYPEFIND:{
GST_OBJECT_LOCK (typefind);
@ -874,11 +873,9 @@ gst_type_find_element_getrange (GstPad * srcpad,
ret = gst_pad_pull_range (typefind->sink, offset, length, buffer);
if (ret == GST_FLOW_OK && buffer && *buffer) {
GST_OBJECT_LOCK (typefind);
/* don't take object lock as typefind->caps should not change anymore */
/* we assume that pulled buffers are meta-data writable */
gst_buffer_set_caps (*buffer, typefind->caps);
GST_OBJECT_UNLOCK (typefind);
}
return ret;