From 6085c0eaee12009c849de29219a6d519f741e757 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 11 Feb 2020 11:21:34 +0100 Subject: [PATCH] v4l2: use the buffer time as pts Don't try to use the seq number as pts, just use the timestamp returned from v4l2 if any so it can be matched against the clock. --- spa/plugins/v4l2/v4l2-utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index f0f627598..a8b5ee87f 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1196,8 +1196,10 @@ static int mmap_read(struct impl *this) b->h->flags = 0; if (buf.flags & V4L2_BUF_FLAG_ERROR) b->h->flags |= SPA_META_HEADER_FLAG_CORRUPTED; + b->h->offset = 0; b->h->seq = buf.sequence; - b->h->pts = buf.sequence * 1000000000LL / port->rate.denom; + b->h->pts = pts; + b->h->dts_offset = 0; } d = b->outbuf->datas;