ffmpeg: make v4l2 buffer dequeue non-blocking (zero timeout)

This commit is contained in:
Joo Aun Saw 2019-08-29 01:17:16 +10:00
parent ee9e54d45d
commit ca1abef244

View File

@ -15,7 +15,7 @@ index efcb0426e4..8f9420e28d 100644
* 2. an input buffer is ready to be dequeued
*/
- avbuf = v4l2_dequeue_v4l2buf(ctx, -1);
+ avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? -1 : 50);
+ avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? -1 : 0);
if (!avbuf) {
if (ctx->done)
return AVERROR_EOF;
@ -24,7 +24,7 @@ index efcb0426e4..8f9420e28d 100644
* 2. an input buffer ready to be dequeued
*/
- avbuf = v4l2_dequeue_v4l2buf(ctx, -1);
+ avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? -1 : 50);
+ avbuf = v4l2_dequeue_v4l2buf(ctx, ctx_to_m2mctx(ctx)->draining ? -1 : 0);
if (!avbuf) {
if (ctx->done)
return AVERROR_EOF;