summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/ximage/ximagesink.c12
-rw-r--r--sys/xvimage/xvimagesink.c12
2 files changed, 16 insertions, 8 deletions
diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c
index 6fa3a35e6..1540d962d 100644
--- a/sys/ximage/ximagesink.c
+++ b/sys/ximage/ximagesink.c
@@ -1312,6 +1312,7 @@ gst_ximagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
res = GST_FLOW_OK;
} else {
GstVideoFrame src, dest;
+ GstBufferPoolAcquireParams params = { 0, };
/* Else we have to copy the data into our private image, */
/* if we have one... */
@@ -1324,8 +1325,11 @@ gst_ximagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
if (!gst_buffer_pool_set_active (ximagesink->pool, TRUE))
goto activate_failed;
- /* take a buffer from our pool */
- res = gst_buffer_pool_acquire_buffer (ximagesink->pool, &to_put, NULL);
+ /* take a buffer from our pool, if there is no buffer in the pool something
+ * is seriously wrong, waiting for the pool here might deadlock when we try
+ * to go to PAUSED because we never flush the pool. */
+ params.flags = GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT;
+ res = gst_buffer_pool_acquire_buffer (ximagesink->pool, &to_put, &params);
if (res != GST_FLOW_OK)
goto no_buffer;
@@ -1367,12 +1371,12 @@ no_buffer:
{
/* No image available. That's very bad ! */
GST_WARNING_OBJECT (ximagesink, "could not create image");
- return res;
+ return GST_FLOW_OK;
}
invalid_buffer:
{
/* No Window available to put our image into */
- GST_WARNING_OBJECT (ximagesink, "could map image");
+ GST_WARNING_OBJECT (ximagesink, "could not map image");
res = GST_FLOW_OK;
goto done;
}
diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c
index e631b2a03..c766d2510 100644
--- a/sys/xvimage/xvimagesink.c
+++ b/sys/xvimage/xvimagesink.c
@@ -1831,6 +1831,7 @@ gst_xvimagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
res = GST_FLOW_OK;
} else {
GstVideoFrame src, dest;
+ GstBufferPoolAcquireParams params = { 0, };
/* Else we have to copy the data into our private image, */
/* if we have one... */
@@ -1843,8 +1844,11 @@ gst_xvimagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
if (!gst_buffer_pool_set_active (xvimagesink->pool, TRUE))
goto activate_failed;
- /* take a buffer from our pool */
- res = gst_buffer_pool_acquire_buffer (xvimagesink->pool, &to_put, NULL);
+ /* take a buffer from our pool, if there is no buffer in the pool something
+ * is seriously wrong, waiting for the pool here might deadlock when we try
+ * to go to PAUSED because we never flush the pool then. */
+ params.flags = GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT;
+ res = gst_buffer_pool_acquire_buffer (xvimagesink->pool, &to_put, &params);
if (res != GST_FLOW_OK)
goto no_buffer;
@@ -1886,12 +1890,12 @@ no_buffer:
{
/* No image available. That's very bad ! */
GST_WARNING_OBJECT (xvimagesink, "could not create image");
- return res;
+ return GST_FLOW_OK;
}
invalid_buffer:
{
/* No Window available to put our image into */
- GST_WARNING_OBJECT (xvimagesink, "could map image");
+ GST_WARNING_OBJECT (xvimagesink, "could not map image");
res = GST_FLOW_OK;
goto done;
}