summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-09-20 08:22:20 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-10-01 09:19:48 +0200
commit880a8fc077301d0b1ebc642ac53373bd0e0707e1 (patch)
tree4971379c7902f595de0fe2bbb25b424b735f7d19 /drivers/media
parentmedia: hist-v4l2.rst: remove :c:`type` from structs and enums (diff)
downloadlinux-880a8fc077301d0b1ebc642ac53373bd0e0707e1.tar.xz
linux-880a8fc077301d0b1ebc642ac53373bd0e0707e1.zip
media: vidtv: simplify PCR logic to get jiffies
There's no need to have a check when setting timing.past_jiffies, as we can simply do the initialization earlier at vidtv_mux_init(). Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/test-drivers/vidtv/vidtv_mux.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/media/test-drivers/vidtv/vidtv_mux.c b/drivers/media/test-drivers/vidtv/vidtv_mux.c
index 43b13aa3a8bc..6a3123c51cc4 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_mux.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_mux.c
@@ -100,11 +100,7 @@ static void vidtv_mux_update_clk(struct vidtv_mux *m)
/* call this at every thread iteration */
u64 elapsed_time;
- /* this will not hold a value yet if we have just started */
- m->timing.past_jiffies = m->timing.current_jiffies ?
- m->timing.current_jiffies :
- get_jiffies_64();
-
+ m->timing.past_jiffies = m->timing.current_jiffies;
m->timing.current_jiffies = get_jiffies_64();
elapsed_time = jiffies_to_usecs(m->timing.current_jiffies -
@@ -449,6 +445,7 @@ struct vidtv_mux *vidtv_mux_init(struct dvb_frontend *fe,
m->pcr_pid = args.pcr_pid;
m->transport_stream_id = args.transport_stream_id;
m->priv = args.priv;
+ m->timing.current_jiffies = get_jiffies_64();
if (args.channels)
m->channels = args.channels;