[vlc-commits] modules: get the frame duration using vlc_tick_rate_duration()

Steve Lhomme git at videolan.org
Wed Sep 19 15:46:30 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Sep 19 14:33:08 2018 +0200| [1e3dc117cff996d12dcafbe25fbc8f8a9fd713c6] | committer: Steve Lhomme

modules: get the frame duration using vlc_tick_rate_duration()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1e3dc117cff996d12dcafbe25fbc8f8a9fd713c6
---

 modules/access/screen/screen.c | 2 +-
 modules/access/screen/win32.c  | 2 +-
 modules/access/vnc.c           | 2 +-
 modules/demux/mjpeg.c          | 2 +-
 modules/demux/rawdv.c          | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/access/screen/screen.c b/modules/access/screen/screen.c
index c2b27c5c76..88ff50bd9c 100644
--- a/modules/access/screen/screen.c
+++ b/modules/access/screen/screen.c
@@ -155,7 +155,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_ENOMEM;
 
     p_sys->f_fps = var_CreateGetFloat( p_demux, "screen-fps" );
-    p_sys->i_incr = CLOCK_FREQ / p_sys->f_fps;
+    p_sys->i_incr = vlc_tick_rate_duration( p_sys->f_fps );
     p_sys->i_next_date = 0;
 
 #ifdef SCREEN_SUBSCREEN
diff --git a/modules/access/screen/win32.c b/modules/access/screen/win32.c
index c80dcc9df6..adf4fdb386 100644
--- a/modules/access/screen/win32.c
+++ b/modules/access/screen/win32.c
@@ -231,7 +231,7 @@ static block_t *CaptureBlockNew( demux_t *p_demux )
                                             (int)p_sys->fmt.video.i_height :
                                             p_data->i_fragment_size;
         p_sys->f_fps *= (p_sys->fmt.video.i_height/p_data->i_fragment_size);
-        p_sys->i_incr = CLOCK_FREQ / p_sys->f_fps;
+        p_sys->i_incr = vlc_tick_rate_duration( p_sys->f_fps );
         p_data->i_fragment = 0;
         p_data->p_block = 0;
     }
diff --git a/modules/access/vnc.c b/modules/access/vnc.c
index 6bf98ec62e..28084a4d18 100644
--- a/modules/access/vnc.c
+++ b/modules/access/vnc.c
@@ -395,7 +395,7 @@ static int Open( vlc_object_t *p_this )
 
     p_sys->f_fps = var_InheritFloat( p_demux, CFG_PREFIX "fps" );
     if ( p_sys->f_fps <= 0 ) p_sys->f_fps = 1.0;
-    p_sys->i_frame_interval = CLOCK_FREQ / p_sys->f_fps ;
+    p_sys->i_frame_interval = vlc_tick_rate_duration( p_sys->f_fps );
 
     char *psz_chroma = var_InheritString( p_demux, CFG_PREFIX "chroma" );
     vlc_fourcc_t i_chroma = vlc_fourcc_GetCodecFromString( VIDEO_ES, psz_chroma );
diff --git a/modules/demux/mjpeg.c b/modules/demux/mjpeg.c
index 7b1db17a70..da3a5a1570 100644
--- a/modules/demux/mjpeg.c
+++ b/modules/demux/mjpeg.c
@@ -378,7 +378,7 @@ static int Open( vlc_object_t * p_this )
     }
     else
         p_sys->b_still = false;
-    p_sys->i_frame_length = f_fps ? (CLOCK_FREQ / f_fps) : VLC_TICK_INVALID;
+    p_sys->i_frame_length = f_fps ? vlc_tick_rate_duration(f_fps) : VLC_TICK_INVALID;
 
     es_format_Init( &p_sys->fmt, VIDEO_ES, VLC_CODEC_MJPG );
 
diff --git a/modules/demux/rawdv.c b/modules/demux/rawdv.c
index 5520dee84d..1c5369a9cf 100644
--- a/modules/demux/rawdv.c
+++ b/modules/demux/rawdv.c
@@ -288,7 +288,7 @@ static int Demux( demux_t *p_demux )
 
     if( !p_sys->b_hurry_up )
     {
-        p_sys->i_pcr += CLOCK_FREQ / p_sys->f_rate;
+        p_sys->i_pcr += vlc_tick_rate_duration( p_sys->f_rate );
     }
 
     return VLC_DEMUXER_SUCCESS;



More information about the vlc-commits mailing list