summaryrefslogtreecommitdiffstats
path: root/sys/v4l2
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-06-09 16:44:31 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-06-09 16:44:31 +0000
commit90ce70aa406c964c80f1d3df857073cc01813be7 (patch)
tree0c919f73668ad0d8a51543e69798c545d31dfe68 /sys/v4l2
parent9fb2c57295d79232446e00107442351d24275998 (diff)
downloadgst-plugins-bad-90ce70aa406c964c80f1d3df857073cc01813be7.tar.gz
gst-plugins-bad-90ce70aa406c964c80f1d3df857073cc01813be7.tar.bz2
gst-plugins-bad-90ce70aa406c964c80f1d3df857073cc01813be7.zip
sys/v4l2/gstv4l2src.c: Don't use bytesused/length of a buffer for GST_BUFFER_SIZE(), since length is the allocated le...
Original commit message from CVS: * sys/v4l2/gstv4l2src.c: (gst_v4l2src_get): Don't use bytesused/length of a buffer for GST_BUFFER_SIZE(), since length is the allocated length in the kernel, which may be more, and bytesused is not set by all drivers and may be less if part of the frame was lost. Instead, use the calculated piximage size. Fixes #301718.
Diffstat (limited to 'sys/v4l2')
-rw-r--r--sys/v4l2/gstv4l2src.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index 45b60bde..b563d9c6 100644
--- a/sys/v4l2/gstv4l2src.c
+++ b/sys/v4l2/gstv4l2src.c
@@ -907,9 +907,7 @@ gst_v4l2src_get (GstPad * pad)
g_assert (num != -1);
GST_LOG_OBJECT (v4l2src, "buffer %d needs %d writes", num,
v4l2src->need_writes + 1);
- i = v4l2src->pool->buffers[num].buffer.bytesused >
- 0 ? v4l2src->pool->buffers[num].buffer.bytesused : v4l2src->pool->
- buffers[num].length;
+ i = v4l2src->format.fmt.pix.sizeimage;
/* check if this is the last buffer in the queue. If so do a memcpy to put it back asap
to avoid framedrops and deadlocks because of stupid elements */
if (gst_atomic_int_read (&v4l2src->pool->refcount) == v4l2src->breq.count) {