Browse Source

modules: replace hardcoded CLOCK_FREQ multiples by VTICK_FROM_SEC()

pull/73/head
Steve Lhomme 8 years ago
parent
commit
d5e794f802
  1. 2
      modules/access/dvb/access.c
  2. 2
      modules/access/mms/mmstu.c
  3. 2
      modules/codec/zvbi.c
  4. 4
      modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp
  5. 2
      modules/demux/adaptive/playlist/AbstractPlaylist.cpp
  6. 4
      modules/demux/flac.c
  7. 2
      modules/demux/hls/playlist/M3U8.cpp
  8. 2
      modules/demux/mp4/mp4.c
  9. 2
      modules/demux/smooth/playlist/Manifest.cpp
  10. 6
      modules/gui/macosx/VLCBookmarksWindowController.m
  11. 6
      modules/gui/qt/dialogs/bookmarks.cpp
  12. 2
      modules/lua/extension.h
  13. 2
      modules/packetizer/h264.c
  14. 2
      modules/services_discovery/mtp.c
  15. 2
      modules/spu/mosaic.c
  16. 18
      modules/video_filter/oldmovie.c
  17. 8
      modules/video_filter/vhs.c

2
modules/access/dvb/access.c

@ -107,7 +107,7 @@ static int Control( stream_t *, int, va_list );
static block_t *BlockScan( stream_t *, bool * );
#define DVB_SCAN_MAX_LOCK_TIME (2*CLOCK_FREQ)
#define DVB_SCAN_MAX_LOCK_TIME VLC_TICK_FROM_SEC(2)
static void FilterUnset( stream_t *, int i_max );
static void FilterSet( stream_t *, int i_pid, int i_type );

2
modules/access/mms/mmstu.c

@ -1611,7 +1611,7 @@ noreturn static void *KeepAliveThread( void *p_data )
vlc_restorecancel( canc );
vlc_tick_sleep( 10 * CLOCK_FREQ );
vlc_tick_sleep( VLC_TICK_FROM_SEC(10) );
}
vlc_assert_unreachable();
}

2
modules/codec/zvbi.c

@ -559,7 +559,7 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
p_spu->p_region->i_y = 0;
p_spu->i_start = i_pts;
p_spu->i_stop = b_text ? i_pts + (10*CLOCK_FREQ): 0;
p_spu->i_stop = b_text ? i_pts + VLC_TICK_FROM_SEC(10): 0;
p_spu->b_ephemer = true;
p_spu->b_absolute = b_text ? false : true;

4
modules/demux/adaptive/logic/NearOptimalAdaptationLogic.cpp

@ -40,8 +40,8 @@ using namespace adaptive;
* http://arxiv.org/abs/1601.06748
*/
#define minimumBufferS (CLOCK_FREQ * 6) /* Qmin */
#define bufferTargetS (CLOCK_FREQ * 30) /* Qmax */
#define minimumBufferS VLC_TICK_FROM_SEC(6) /* Qmin */
#define bufferTargetS VLC_TICK_FROM_SEC(30) /* Qmax */
NearOptimalContext::NearOptimalContext()
: buffering_min( minimumBufferS )

2
modules/demux/adaptive/playlist/AbstractPlaylist.cpp

@ -41,7 +41,7 @@ AbstractPlaylist::AbstractPlaylist (vlc_object_t *p_object_) :
availabilityStartTime.Set( 0 );
availabilityEndTime.Set( 0 );
duration.Set( 0 );
minUpdatePeriod.Set( 2 * CLOCK_FREQ );
minUpdatePeriod.Set( VLC_TICK_FROM_SEC(2) );
maxSegmentDuration.Set( 0 );
minBufferTime = 0;
timeShiftBufferDepth.Set( 0 );

4
modules/demux/flac.c

@ -105,8 +105,8 @@ typedef struct
} demux_sys_t;
#define FLAC_PACKET_SIZE 16384
#define FLAC_MAX_PREROLL (CLOCK_FREQ * 4)
#define FLAC_MAX_SLOW_PREROLL (CLOCK_FREQ * 45)
#define FLAC_MAX_PREROLL VLC_TICK_FROM_SEC(4)
#define FLAC_MAX_SLOW_PREROLL VLC_TICK_FROM_SEC(45)
/*****************************************************************************
* Open: initializes ES structures

2
modules/demux/hls/playlist/M3U8.cpp

@ -37,7 +37,7 @@ M3U8::M3U8 (vlc_object_t *p_object, AuthStorage *auth_) :
AbstractPlaylist(p_object)
{
auth = auth_;
minUpdatePeriod.Set( 5 * CLOCK_FREQ );
minUpdatePeriod.Set( VLC_TICK_FROM_SEC(5) );
vlc_mutex_init(&keystore_lock);
}

2
modules/demux/mp4/mp4.c

@ -144,7 +144,7 @@ typedef struct
} demux_sys_t;
#define DEMUX_INCREMENT (CLOCK_FREQ / 4) /* How far the pcr will go, each round */
#define DEMUX_TRACK_MAX_PRELOAD (CLOCK_FREQ * 15) /* maximum preloading, to deal with interleaving */
#define DEMUX_TRACK_MAX_PRELOAD VLC_TICK_FROM_SEC(15) /* maximum preloading, to deal with interleaving */
#define VLC_DEMUXER_EOS (VLC_DEMUXER_EGENERIC - 1)
#define VLC_DEMUXER_FATAL (VLC_DEMUXER_EGENERIC - 2)

2
modules/demux/smooth/playlist/Manifest.cpp

@ -31,7 +31,7 @@ using namespace smooth::playlist;
Manifest::Manifest (vlc_object_t *p_object) :
AbstractPlaylist(p_object), TimescaleAble()
{
minUpdatePeriod.Set( 5 * CLOCK_FREQ );
minUpdatePeriod.Set( VLC_TICK_FROM_SEC(5) );
setTimescale( 10000000 );
b_live = false;
}

6
modules/gui/macosx/VLCBookmarksWindowController.m

@ -304,9 +304,9 @@ clear:
assert(bookmark != NULL);
vlc_tick_t total = bookmark->i_time_offset;
uint64_t hour = ( total / ( CLOCK_FREQ * 3600 ) );
uint64_t min = ( total % ( CLOCK_FREQ * 3600 ) ) / ( CLOCK_FREQ * 60 );
float sec = ( total % ( CLOCK_FREQ * 60 ) ) / ( CLOCK_FREQ * 1. );
uint64_t hour = ( total / VLC_TICK_FROM_SEC(3600) );
uint64_t min = ( total % VLC_TICK_FROM_SEC(3600) ) / VLC_TICK_FROM_SEC(60);
float sec = ( total % VLC_TICK_FROM_SEC(60) ) / ( CLOCK_FREQ * 1. );
return [NSString stringWithFormat:@"%02llu:%02llu:%06.3f", hour, min, sec];
}

6
modules/gui/qt/dialogs/bookmarks.cpp

@ -139,9 +139,9 @@ void BookmarksDialog::update()
for( int i = 0; i < i_bookmarks; i++ )
{
vlc_tick_t total = pp_bookmarks[i]->i_time_offset;
unsigned hours = ( total / ( CLOCK_FREQ * 3600 ) );
unsigned minutes = ( total % ( CLOCK_FREQ * 3600 ) ) / ( CLOCK_FREQ * 60 );
float seconds = ( total % ( CLOCK_FREQ * 60 ) ) / ( CLOCK_FREQ * 1. );
unsigned hours = ( total / VLC_TICK_FROM_SEC(3600) );
unsigned minutes = ( total % VLC_TICK_FROM_SEC(3600) ) / VLC_TICK_FROM_SEC(60);
float seconds = ( total % VLC_TICK_FROM_SEC(60) ) / ( CLOCK_FREQ * 1. );
QStringList row;
row << QString( qfu( pp_bookmarks[i]->psz_name ) );

2
modules/lua/extension.h

@ -28,7 +28,7 @@
#include <vlc_arrays.h>
#include <vlc_dialog.h>
#define WATCH_TIMER_PERIOD (10 * CLOCK_FREQ) ///< 10s period for the timer
#define WATCH_TIMER_PERIOD VLC_TICK_FROM_SEC(10) ///< 10s period for the timer
/* List of available commands */
typedef enum

2
modules/packetizer/h264.c

@ -970,7 +970,7 @@ static block_t *OutputPicture( decoder_t *p_dec )
tFOC, bFOC, PictureOrderCount,
p_sys->slice.type, p_sys->b_recovered, p_pic->i_flags,
p_sys->slice.i_nal_ref_idc, p_sys->slice.i_frame_num, p_sys->slice.i_field_pic_flag,
p_pic->i_pts - p_pic->i_dts, p_pic->i_pts % (100*CLOCK_FREQ), p_pic->i_length);
p_pic->i_pts - p_pic->i_dts, p_pic->i_pts % VLC_TICK_FROM_SEC(100), p_pic->i_length);
#endif
/* save for next pic fixups */

2
modules/services_discovery/mtp.c

@ -166,7 +166,7 @@ static void *Run( void *data )
vlc_restorecancel(canc);
if( i_status == 2 )
{
vlc_tick_sleep( 5*CLOCK_FREQ );
vlc_tick_sleep( VLC_TICK_FROM_SEC(5) );
i_status = 0;
}
else

2
modules/spu/mosaic.c

@ -40,7 +40,7 @@
#include "mosaic.h"
#define BLANK_DELAY (1*CLOCK_FREQ)
#define BLANK_DELAY VLC_TICK_FROM_SEC(1)
/*****************************************************************************
* Local prototypes

18
modules/video_filter/oldmovie.c

@ -401,7 +401,7 @@ static int oldmovie_sliding_offset_effect( filter_t *p_filter, picture_t *p_pic_
* one shot offset section
*/
#define OFFSET_AVERAGE_PERIOD (10 * CLOCK_FREQ)
#define OFFSET_AVERAGE_PERIOD VLC_TICK_FROM_SEC(10)
/* start trigger to be (re)initialized */
if ( p_sys->i_offset_trigger == 0
@ -424,8 +424,8 @@ static int oldmovie_sliding_offset_effect( filter_t *p_filter, picture_t *p_pic_
* sliding section
*/
#define SLIDING_AVERAGE_PERIOD (20 * CLOCK_FREQ)
#define SLIDING_AVERAGE_DURATION ( 3 * CLOCK_FREQ)
#define SLIDING_AVERAGE_PERIOD VLC_TICK_FROM_SEC(20)
#define SLIDING_AVERAGE_DURATION VLC_TICK_FROM_SEC(3)
/* start trigger to be (re)initialized */
if ( ( p_sys->i_sliding_stop_trig == 0 )
@ -575,7 +575,7 @@ static int oldmovie_film_scratch_effect( filter_t *p_filter, picture_t *p_pic_ou
{
filter_sys_t *p_sys = p_filter->p_sys;
#define SCRATCH_GENERATOR_PERIOD ( CLOCK_FREQ * 2 )
#define SCRATCH_GENERATOR_PERIOD VLC_TICK_FROM_SEC(2)
#define SCRATCH_DURATION ( CLOCK_FREQ * 1 / 2)
/* generate new scratch */
@ -636,7 +636,7 @@ static void oldmovie_film_blotch_effect( filter_t *p_filter, picture_t *p_pic_ou
{
filter_sys_t *p_sys = p_filter->p_sys;
#define BLOTCH_GENERATOR_PERIOD ( CLOCK_FREQ * 5 )
#define BLOTCH_GENERATOR_PERIOD VLC_TICK_FROM_SEC(5)
/* generate blotch */
if ( p_sys->i_blotch_trigger <= p_sys->i_cur_time ) {
@ -693,10 +693,10 @@ static void oldmovie_film_dust_effect( filter_t *p_filter, picture_t *p_pic_out
* Hair and dust on projector lens
*
*/
#define HAIR_GENERATOR_PERIOD ( CLOCK_FREQ * 50 )
#define HAIR_DURATION ( CLOCK_FREQ * 50 )
#define DUST_GENERATOR_PERIOD ( CLOCK_FREQ * 100 )
#define DUST_DURATION ( CLOCK_FREQ * 4 )
#define HAIR_GENERATOR_PERIOD VLC_TICK_FROM_SEC(50)
#define HAIR_DURATION VLC_TICK_FROM_SEC(50)
#define DUST_GENERATOR_PERIOD VLC_TICK_FROM_SEC(100)
#define DUST_DURATION VLC_TICK_FROM_SEC(4)
/**
* Define hair location on the lens and timeout

8
modules/video_filter/vhs.c

@ -263,7 +263,7 @@ static void vhs_free_allocated_data( filter_t *p_filter ) {
static int vhs_blue_red_line_effect( filter_t *p_filter, picture_t *p_pic_out ) {
filter_sys_t *p_sys = p_filter->p_sys;
#define BR_LINES_GENERATOR_PERIOD ( CLOCK_FREQ * 50 )
#define BR_LINES_GENERATOR_PERIOD VLC_TICK_FROM_SEC(50)
#define BR_LINES_DURATION ( CLOCK_FREQ * 1/50 )
/* generate new blue or red lines */
@ -394,7 +394,7 @@ static int vhs_sliding_effect( filter_t *p_filter, picture_t *p_pic_out ) {
* one shot offset section
*/
#define OFFSET_AVERAGE_PERIOD (10 * CLOCK_FREQ)
#define OFFSET_AVERAGE_PERIOD VLC_TICK_FROM_SEC(10)
/* start trigger to be (re)initialized */
if ( p_sys->i_offset_trigger == 0
@ -432,8 +432,8 @@ static int vhs_sliding_effect( filter_t *p_filter, picture_t *p_pic_out ) {
* sliding section
*/
#define SLIDING_AVERAGE_PERIOD (20 * CLOCK_FREQ)
#define SLIDING_AVERAGE_DURATION ( 3 * CLOCK_FREQ)
#define SLIDING_AVERAGE_PERIOD VLC_TICK_FROM_SEC(20)
#define SLIDING_AVERAGE_DURATION VLC_TICK_FROM_SEC(3)
/* start trigger to be (re)initialized */
if ( ( p_sys->i_sliding_stop_trig == 0 ) &&

Loading…
Cancel
Save