[FFmpeg-devel,24/25] avcodec/v4l2_buffers: extract v4l2_timebase constant

Submitted by Aman Gupta on Sept. 3, 2019, 1:02 a.m.

Details

Message ID 20190903010230.96236-25-ffmpeg@tmm1.net
State New
Headers show

Commit Message

Aman Gupta Sept. 3, 2019, 1:02 a.m.
From: Aman Gupta <aman@tmm1.net>

Signed-off-by: Aman Gupta <aman@tmm1.net>
---
 libavcodec/v4l2_buffers.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c
index d8cec06cb3..8424fbcd3e 100644
--- a/libavcodec/v4l2_buffers.c
+++ b/libavcodec/v4l2_buffers.c
@@ -42,6 +42,7 @@ 
 #include "v4l2_m2m.h"
 
 #define USEC_PER_SEC 1000000
+static AVRational v4l2_timebase = { 1, USEC_PER_SEC };
 
 static inline V4L2m2mContext *buf_to_m2mctx(V4L2Buffer *buf)
 {
@@ -68,7 +69,6 @@  static inline AVRational v4l2_get_timebase(V4L2Buffer *avbuf)
 
 static inline void v4l2_set_pts(V4L2Buffer *out, int64_t pts)
 {
-    AVRational v4l2_timebase = { 1, USEC_PER_SEC };
     int64_t v4l2_pts;
 
     if (pts == AV_NOPTS_VALUE)
@@ -82,7 +82,6 @@  static inline void v4l2_set_pts(V4L2Buffer *out, int64_t pts)
 
 static inline int64_t v4l2_get_pts(V4L2Buffer *avbuf)
 {
-    AVRational v4l2_timebase = { 1, USEC_PER_SEC };
     int64_t v4l2_pts;
 
     /* convert pts back to encoder timebase */