From b31832dac9e3243acf217a2d2e1c3c8743b48d24 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 15 Aug 2018 21:33:58 +0200 Subject: [PATCH] v4l2: set pts correctly The pts is supposed to be go in sync with the clock. Our clock is based on sequence numbers so translate the PTS to this as well. --- spa/plugins/v4l2/v4l2-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index da3c904eb..bd303f302 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1170,7 +1170,7 @@ static int mmap_read(struct impl *this) if (buf.flags & V4L2_BUF_FLAG_ERROR) b->h->flags |= SPA_META_HEADER_FLAG_CORRUPTED; b->h->seq = buf.sequence; - b->h->pts = pts; + b->h->pts = buf.sequence * 1000000000LL / port->rate.denom; } d = b->outbuf->datas;