Commit 306ae561 authored by Andy Wingo Wingo's avatar Andy Wingo Wingo
Browse files

sys/ximage/ximagesink.c (gst_ximagesink_renegotiate_size): Protect the height,...

sys/ximage/ximagesink.c (gst_ximagesink_renegotiate_size): Protect the height, width, and desired_caps with the pool_...

Original commit message from CVS:
2005-08-03  Andy Wingo  <wingo@pobox.com>

* sys/ximage/ximagesink.c (gst_ximagesink_renegotiate_size):
(gst_ximagesink_buffer_alloc):
Protect the height, width, and desired_caps with the pool_lock.
Fixes videotestsrc ! queue ! ximagesink.
parent 443cfe92
2005-08-03 Andy Wingo <wingo@pobox.com>
* sys/ximage/ximagesink.c (gst_ximagesink_renegotiate_size):
(gst_ximagesink_buffer_alloc):
Protect the height, width, and desired_caps with the pool_lock.
Fixes videotestsrc ! queue ! ximagesink.
2005-08-02 Edward Hervey <edward@fluendo.com>
 
* gst/volume/gstvolume.c:
......
......@@ -653,10 +653,14 @@ gst_ximagesink_renegotiate_size (GstXImageSink * ximagesink)
}
if (gst_pad_peer_accept_caps (GST_VIDEO_SINK_PAD (ximagesink), caps)) {
g_mutex_lock (ximagesink->pool_lock);
gst_caps_replace (&ximagesink->desired_caps, caps);
GST_VIDEO_SINK_WIDTH (ximagesink) = ximagesink->xwindow->width;
GST_VIDEO_SINK_HEIGHT (ximagesink) = ximagesink->xwindow->height;
g_mutex_unlock (ximagesink->pool_lock);
if (ximagesink->ximage) {
GST_DEBUG_OBJECT (ximagesink, "destroying and recreating our ximage");
gst_ximagesink_ximage_destroy (ximagesink, ximagesink->ximage);
......@@ -1335,8 +1339,6 @@ gst_ximagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
}
}
g_mutex_unlock (ximagesink->pool_lock);
if (!ximage) {
/* We found no suitable image in the pool. Creating... */
gint height, width;
......@@ -1357,9 +1359,13 @@ gst_ximagesink_buffer_alloc (GstBaseSink * bsink, guint64 offset, guint size,
if (ximagesink->desired_caps)
gst_buffer_set_caps (GST_BUFFER (ximage), ximagesink->desired_caps);
else
/* fixme we have no guarantee that the ximage is actually of these caps,
do we? */
gst_buffer_set_caps (GST_BUFFER (ximage), caps);
}
g_mutex_unlock (ximagesink->pool_lock);
*buf = GST_BUFFER (ximage);
return GST_FLOW_OK;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment