[vlc-commits] subsdelay: use VLC_TICK_FROM_MS() and store using vlc_tick_t
Steve Lhomme
git at videolan.org
Tue Sep 18 16:42:33 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jun 13 17:38:49 2018 +0200| [d00662744b7427a1fa64a31f433a50a56ef99181] | committer: Steve Lhomme
subsdelay: use VLC_TICK_FROM_MS() and store using vlc_tick_t
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d00662744b7427a1fa64a31f433a50a56ef99181
---
modules/spu/subsdelay.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/modules/spu/subsdelay.c b/modules/spu/subsdelay.c
index 7244e9942b..314d87ce8e 100644
--- a/modules/spu/subsdelay.c
+++ b/modules/spu/subsdelay.c
@@ -97,10 +97,6 @@ static const char * const ppsz_mode_descriptions[] = { N_( "Absolute delay" ), N
/* max subtitles handled on the heap */
#define SUBSDELAY_MAX_ENTRIES 16
-/* factor convert macros */
-#define MILLISEC_TO_MICROSEC( x ) ( ( x ) * 1000 )
-
-
#define SUBSDELAY_MODE_ABSOLUTE 0
#define SUBSDELAY_MODE_RELATIVE_SOURCE_DELAY 1
#define SUBSDELAY_MODE_RELATIVE_SOURCE_CONTENT 2
@@ -175,11 +171,11 @@ typedef struct
int i_min_alpha; /* oldest subtitle alpha value */
- int64_t i_min_stops_interval;
+ vlc_tick_t i_min_stops_interval;
- int64_t i_min_stop_start_interval;
+ vlc_tick_t i_min_stop_start_interval;
- int64_t i_min_start_stop_interval;
+ vlc_tick_t i_min_start_stop_interval;
subsdelay_heap_t heap; /* subpictures list */
} filter_sys_t;
@@ -329,15 +325,15 @@ static int SubsdelayCreate( vlc_object_t *p_this )
var_AddCallback( p_filter, CFG_MIN_ALPHA, SubsdelayCallback, p_sys );
p_sys->i_min_stops_interval
- = MILLISEC_TO_MICROSEC( var_CreateGetIntegerCommand( p_filter, CFG_MIN_STOPS_INTERVAL ) );
+ = VLC_TICK_FROM_MS( var_CreateGetIntegerCommand( p_filter, CFG_MIN_STOPS_INTERVAL ) );
var_AddCallback( p_filter, CFG_MIN_STOPS_INTERVAL, SubsdelayCallback, p_sys );
p_sys->i_min_stop_start_interval
- = MILLISEC_TO_MICROSEC( var_CreateGetIntegerCommand( p_filter, CFG_MIN_STOP_START_INTERVAL ) );
+ = VLC_TICK_FROM_MS( var_CreateGetIntegerCommand( p_filter, CFG_MIN_STOP_START_INTERVAL ) );
var_AddCallback( p_filter, CFG_MIN_STOP_START_INTERVAL, SubsdelayCallback, p_sys );
p_sys->i_min_start_stop_interval
- = MILLISEC_TO_MICROSEC( var_CreateGetIntegerCommand( p_filter, CFG_MIN_START_STOP_INTERVAL ) );
+ = VLC_TICK_FROM_MS( var_CreateGetIntegerCommand( p_filter, CFG_MIN_START_STOP_INTERVAL ) );
var_AddCallback( p_filter, CFG_MIN_START_STOP_INTERVAL, SubsdelayCallback, p_sys );
p_filter->p_sys = p_sys;
@@ -475,15 +471,15 @@ static int SubsdelayCallback( vlc_object_t *p_this, char const *psz_var, vlc_val
}
else if( !strcmp( psz_var, CFG_MIN_STOPS_INTERVAL ) )
{
- p_sys->i_min_stops_interval = MILLISEC_TO_MICROSEC( newval.i_int );
+ p_sys->i_min_stops_interval = VLC_TICK_FROM_MS( newval.i_int );
}
else if( !strcmp( psz_var, CFG_MIN_STOP_START_INTERVAL ) )
{
- p_sys->i_min_stop_start_interval = MILLISEC_TO_MICROSEC( newval.i_int );
+ p_sys->i_min_stop_start_interval = VLC_TICK_FROM_MS( newval.i_int );
}
else if( !strcmp( psz_var, CFG_MIN_START_STOP_INTERVAL ) )
{
- p_sys->i_min_start_stop_interval = MILLISEC_TO_MICROSEC( newval.i_int );
+ p_sys->i_min_start_stop_interval = VLC_TICK_FROM_MS( newval.i_int );
}
else
{
@@ -771,9 +767,9 @@ static void SubsdelayEnforceDelayRules( filter_t *p_filter )
subsdelay_heap_entry_t ** p_list;
int i_count, i_overlap;
vlc_tick_t i_offset;
- int64_t i_min_stops_interval;
- int64_t i_min_stop_start_interval;
- int64_t i_min_start_stop_interval;
+ vlc_tick_t i_min_stops_interval;
+ vlc_tick_t i_min_stop_start_interval;
+ vlc_tick_t i_min_start_stop_interval;
filter_sys_t *p_sys = p_filter->p_sys;
More information about the vlc-commits
mailing list