On 01/14/2014 06:17 AM, randy wrote: > Yes, it make encoder work. But sadness ./mfc-encode -m /dev/video1 -c > h264,header_mode=1 -d 1 will still output a zero demo.out without > header-mode or set it to zero will works. > What is the problem? It seems infradead repo is not synchronized with our internal repo. Please apply attached patch. Regards Andrzej
>From bccf89a62a2e45cd45f4bf5d4adff9ec8a16b3bd Mon Sep 17 00:00:00 2001 From: Andrzej Hajda <a.hajda@xxxxxxxxxxx> Date: Mon, 20 May 2013 09:24:23 +0200 Subject: [PATCH] Do not stop encoding after empty buffers Signed-off-by: Andrzej Hajda <a.hajda@xxxxxxxxxxx> --- v4l2-mfc-encoder/func_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 1.8.3.2