From bccf89a62a2e45cd45f4bf5d4adff9ec8a16b3bd Mon Sep 17 00:00:00 2001 From: Andrzej Hajda Date: Mon, 20 May 2013 09:24:23 +0200 Subject: Do not stop encoding after empty buffers Signed-off-by: Andrzej Hajda --- v4l2-mfc-encoder/func_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'v4l2-mfc-encoder') diff --git a/v4l2-mfc-encoder/func_dev.c b/v4l2-mfc-encoder/func_dev.c index c3fff54..3cddef1 100644 --- a/v4l2-mfc-encoder/func_dev.c +++ b/v4l2-mfc-encoder/func_dev.c @@ -76,13 +76,13 @@ int func_deq_buf(struct io_dev *dev, enum io_dir dir) for (i = 0; i < bufs->nplanes; ++i) bufs->bytesused[bufs->nplanes * idx + i] = lens[i]; - dbg("Dequeued buffer %d/%d from %d:%d", idx, bufs->count, dev->fd, dir); + dbg("Dequeued buffer %d/%d from %d:%d ret=%d", idx, bufs->count, dev->fd, dir, ret); --dev->io[dir].nbufs; ++dev->io[dir].counter; - if (ret <= 0 || (dev->io[dir].limit && + if (ret < 0 || (dev->io[dir].limit && dev->io[dir].limit <= dev->io[dir].counter)) { dev->io[dir].state = FS_END; dbg("End on %d:%d", dev->fd, dir); -- cgit v1.2.3