Commit 8b0c6bb9 authored by Steve Lhomme's avatar Steve Lhomme

rename msleep() to vlc_tick_sleep()

parent c2eb32c9
......@@ -72,7 +72,7 @@ VLC_API int vlc_sem_wait_i11e(vlc_sem_t *);
VLC_API int vlc_mwait_i11e(vlc_tick_t);
/**
* Interruptible variant of msleep().
* Interruptible variant of vlc_tick_sleep().
*
* Waits for a specified timeout duration or, if the calling thread has an
* interruption context, an interruption.
......
......@@ -833,7 +833,7 @@ VLC_API unsigned long vlc_thread_id(void) VLC_USED;
*
* In principles, the clock has a precision of 1 MHz. But the actual resolution
* may be much lower, especially when it comes to sleeping with vlc_tick_wait() or
* msleep(). Most general-purpose operating systems provide a resolution of
* vlc_tick_sleep(). Most general-purpose operating systems provide a resolution of
* only 100 to 1000 Hz.
*
* \warning The origin date (time value "zero") is not specified. It is
......@@ -862,7 +862,7 @@ VLC_API void vlc_tick_wait(vlc_tick_t deadline);
* \note The delay may be exceeded due to OS scheduling.
* \note This function is a cancellation point.
*/
VLC_API void msleep(vlc_tick_t delay);
VLC_API void vlc_tick_sleep(vlc_tick_t delay);
#define VLC_HARD_MIN_SLEEP (CLOCK_FREQ/100) /* 10 milliseconds = 1 tick at 100Hz */
#define VLC_SOFT_MIN_SLEEP (9*CLOCK_FREQ) /* 9 seconds */
......@@ -917,7 +917,7 @@ vlc_tick_t impossible_deadline( vlc_tick_t deadline )
# define check_deadline(d) (d)
#endif
#define msleep(d) msleep(check_delay(d))
#define vlc_tick_sleep(d) vlc_tick_sleep(check_delay(d))
#define vlc_tick_wait(d) vlc_tick_wait(check_deadline(d))
/**
......
......@@ -408,7 +408,7 @@ static int Demux(demux_t *p_demux)
{
/* Nothing to display yet, just forget */
block_Release(p_block);
msleep(VLC_HARD_MIN_SLEEP);
vlc_tick_sleep(VLC_HARD_MIN_SLEEP);
return 1;
}
else if ( !p_sys->b_es_setup )
......
......@@ -2216,7 +2216,7 @@ static void blurayStillImage( demux_t *p_demux, unsigned i_timeout )
}
/* avoid busy loops (read returns no data) */
msleep( 40000 );
vlc_tick_sleep( 40000 );
}
static void blurayStreamSelect(demux_t *p_demux, uint32_t i_type, uint32_t i_id)
......@@ -2400,7 +2400,7 @@ static void blurayHandleEvent(demux_t *p_demux, const BD_EVENT *e)
case BD_EVENT_IDLE:
/* nothing to do (ex. BD-J is preparing menus, waiting user input or running animation) */
/* avoid busy loop (bd_read() returns no data) */
msleep( 40000 );
vlc_tick_sleep( 40000 );
break;
default:
......
......@@ -470,7 +470,7 @@ static int Demux( demux_t *p_demux )
/* Sleep so we do not consume all the cpu, 10ms seems
* like a good value (100fps)
*/
msleep( VLC_HARD_MIN_SLEEP );
vlc_tick_sleep( VLC_HARD_MIN_SLEEP );
return 1;
}
......
......@@ -1267,7 +1267,7 @@ static void CAPMTAdd( cam_t * p_cam, int i_session_id,
}
#ifdef CAPMT_WAIT
msleep( CAPMT_WAIT * 1000 );
vlc_tick_sleep( CAPMT_WAIT * 1000 );
#endif
msg_Dbg( p_cam->obj, "adding CAPMT for SID %d on session %d",
......@@ -1960,7 +1960,7 @@ cam_t *en50221_Init( vlc_object_t *obj, int fd )
p_cam->i_timeout = CLOCK_FREQ / 10;
/* Wait a bit otherwise it doesn't initialize properly... */
msleep( CLOCK_FREQ / 10 );
vlc_tick_sleep( CLOCK_FREQ / 10 );
p_cam->i_next_event = 0;
}
else
......
......@@ -821,7 +821,7 @@ known:
unsigned satno = var_InheritInteger (d->obj, "dvb-satno");
if (satno > 0)
{
#undef msleep /* we know what we are doing! */
#undef vlc_tick_sleep /* we know what we are doing! */
/* DiSEqC Bus Specification:
http://www.eutelsat.com/satellites/pdf/Diseqc/Reference%20docs/bus_spec.pdf */
......@@ -843,7 +843,7 @@ known:
cmd.msg[4] = cmd.msg[5] = 0; /* unused */
cmd.msg_len = 4; /* length */
msleep (15000); /* wait 15 ms before DiSEqC command */
vlc_tick_sleep (15000); /* wait 15 ms before DiSEqC command */
unsigned uncommitted = var_InheritInteger (d->obj, "dvb-uncommitted");
if (uncommitted > 0)
{
......@@ -872,7 +872,7 @@ known:
vlc_strerror_c(errno));
return -1;
}
msleep(125000); /* wait 125 ms before committed DiSEqC command */
vlc_tick_sleep(125000); /* wait 125 ms before committed DiSEqC command */
}
if (ioctl (d->frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd) < 0)
{
......@@ -880,7 +880,7 @@ known:
vlc_strerror_c(errno));
return -1;
}
msleep (54000 + 15000);
vlc_tick_sleep (54000 + 15000);
/* Mini-DiSEqC */
satno &= 1;
......@@ -891,7 +891,7 @@ known:
vlc_strerror_c(errno));
return -1;
}
msleep (15000);
vlc_tick_sleep (15000);
}
/* Continuous tone (to select high oscillator frequency) */
......
......@@ -685,7 +685,7 @@ static int DoDiseqc( vlc_object_t *p_access, dvb_sys_t *p_sys )
}
/* Wait for at least 15 ms. */
msleep(15000);
vlc_tick_sleep(15000);
i_val = var_GetInteger( p_access, "dvb-satno" );
if( i_val > 0 && i_val < 5 )
......@@ -713,7 +713,7 @@ static int DoDiseqc( vlc_object_t *p_access, dvb_sys_t *p_sys )
return VLC_EGENERIC;
}
msleep(15000 + cmd.wait * 1000);
vlc_tick_sleep(15000 + cmd.wait * 1000);
/* A or B simple diseqc ("diseqc-compatible") */
if( ioctl( p_sys->i_frontend_handle, FE_DISEQC_SEND_BURST,
......@@ -724,7 +724,7 @@ static int DoDiseqc( vlc_object_t *p_access, dvb_sys_t *p_sys )
return VLC_EGENERIC;
}
msleep(15000);
vlc_tick_sleep(15000);
}
if( ioctl( p_sys->i_frontend_handle, FE_SET_TONE, fe_tone ) )
......@@ -735,7 +735,7 @@ static int DoDiseqc( vlc_object_t *p_access, dvb_sys_t *p_sys )
return VLC_EGENERIC;
}
msleep(50000);
vlc_tick_sleep(50000);
return 0;
}
......
......@@ -884,7 +884,7 @@ static int Demux( demux_t *p_demux )
DemuxForceStill( p_demux );
p_sys->b_reset_pcr = true;
}
msleep( 40000 );
vlc_tick_sleep( 40000 );
break;
}
......@@ -1109,7 +1109,7 @@ static int Demux( demux_t *p_demux )
es_out_Control( p_demux->out, ES_OUT_GET_EMPTY, &b_empty );
if( !b_empty )
{
msleep( 40*1000 );
vlc_tick_sleep( 40*1000 );
}
else
{
......
......@@ -34,7 +34,7 @@
#include "h2frame.h"
#include "h2output.h"
#undef msleep
#undef vlc_tick_sleep
static unsigned char counter = 0;
static bool send_failure = false;
......@@ -160,7 +160,7 @@ int main(void)
assert(vlc_h2_output_send(out, frame(10)) == 0);
for (unsigned char i = 11; vlc_h2_output_send(out, frame(i)) == 0; i++)
msleep(CLOCK_FREQ/10); /* eventually, it should start failing */
vlc_tick_sleep(CLOCK_FREQ/10); /* eventually, it should start failing */
assert(vlc_h2_output_send(out, frame(0)) == -1);
assert(vlc_h2_output_send_prio(out, frame(0)) == -1);
vlc_h2_output_destroy(out);
......@@ -174,7 +174,7 @@ int main(void)
vlc_sem_wait(&rx);
for (unsigned char i = 1; vlc_h2_output_send_prio(out, frame(i)) == 0; i++)
msleep(CLOCK_FREQ/10);
vlc_tick_sleep(CLOCK_FREQ/10);
assert(vlc_h2_output_send(out, frame(0)) == -1);
assert(vlc_h2_output_send_prio(out, frame(0)) == -1);
vlc_h2_output_destroy(out);
......
......@@ -56,7 +56,7 @@ static int DemuxNoOp( demux_t *demux )
static int DemuxHold( demux_t *demux )
{
(void) demux;
msleep( VLC_HARD_MIN_SLEEP ); /* FIXME!!! */
vlc_tick_sleep( VLC_HARD_MIN_SLEEP ); /* FIXME!!! */
return 1;
}
......@@ -74,7 +74,7 @@ static int DemuxPause( demux_t *demux )
if( now >= p_sys->end )
return 0;
msleep( VLC_HARD_MIN_SLEEP ); /* FIXME!!! */
vlc_tick_sleep( VLC_HARD_MIN_SLEEP ); /* FIXME!!! */
return 1;
}
......
......@@ -432,9 +432,9 @@ static block_t *GrabJack( demux_t *p_demux )
if( i_read < 100 ) /* avoid small read */
{ /* vlc has too much free time on its hands? */
#undef msleep
#undef vlc_tick_sleep
#warning Hmm.... looks wrong
msleep(1000);
vlc_tick_sleep(1000);
return NULL;
}
......
......@@ -1611,7 +1611,7 @@ noreturn static void *KeepAliveThread( void *p_data )
vlc_restorecancel( canc );
msleep( 10 * CLOCK_FREQ );
vlc_tick_sleep( 10 * CLOCK_FREQ );
}
vlc_assert_unreachable();
}
......
......@@ -517,7 +517,7 @@ static int Demux(demux_t *p_demux)
block_Release(p_blocka);
// Nothing to transfer yet, just forget
msleep(VLC_HARD_MIN_SLEEP);
vlc_tick_sleep(VLC_HARD_MIN_SLEEP);
return 1;
}
......
......@@ -415,7 +415,7 @@ static void satip_teardown(void *data) {
/* Extra sleep for compatibility with some satip servers, that
* can't handle new sessions right after teardown */
msleep(150000);
vlc_tick_sleep(150000);
}
}
}
......
......@@ -367,7 +367,7 @@ static int Open( vlc_object_t *p_this )
if ( i_ret != SHOUTERR_CONNECTED )
{
msg_Warn( p_access, "unable to establish connection, retrying..." );
msleep( 30000000 );
vlc_tick_sleep( 30000000 );
}
}
......
......@@ -250,7 +250,7 @@ ca_Flush(audio_output_t *p_aout, bool wait)
const vlc_tick_t i_frame_us =
FramesToUs(p_sys, BytesToFrames(p_sys, p_sys->i_out_size)) + 10000;
lock_unlock(p_sys);
msleep(i_frame_us);
vlc_tick_sleep(i_frame_us);
lock_lock(p_sys);
}
}
......@@ -336,7 +336,7 @@ ca_Play(audio_output_t * p_aout, block_t * p_block, vlc_tick_t date)
/* Wait for the render buffer to play the remaining data */
lock_unlock(p_sys);
msleep(i_frame_us);
vlc_tick_sleep(i_frame_us);
lock_lock(p_sys);
}
else
......
......@@ -1170,7 +1170,7 @@ static void * PlayedDataEraser( void * data )
wait:
vlc_mutex_unlock(&p_sys->lock);
vlc_restorecancel(canc);
msleep(tosleep);
vlc_tick_sleep(tosleep);
}
return NULL;
}
......@@ -339,7 +339,7 @@ static void Flush(audio_output_t *p_aout, bool wait)
{
vlc_tick_t delay;
if (!TimeGet(p_aout, &delay))
msleep(delay);
vlc_tick_sleep(delay);
}
/* reset ringbuffer read and write pointers */
......
......@@ -184,7 +184,7 @@ static void Flush(audio_output_t *aout, bool drain)
if (drain) {
vlc_tick_t delay;
if (!TimeGet(aout, &delay))
msleep(delay);
vlc_tick_sleep(delay);
} else {
vlc_mutex_lock(&sys->lock);
SetPlayState(sys->playerPlay, SL_PLAYSTATE_STOPPED);
......
......@@ -570,7 +570,7 @@ static void Flush(audio_output_t *aout, bool wait)
* See #18141: drain callback is never received */
vlc_tick_t delay;
if (TimeGet(aout, &delay) == 0 && delay <= INT64_C(5000000))
msleep(delay);
vlc_tick_sleep(delay);
}
else
op = pa_stream_flush(s, NULL, NULL);
......
......@@ -197,7 +197,7 @@ static HRESULT Play(aout_stream_t *s, block_t *block)
break; /* done */
/* Out of buffer space, sleep */
msleep(sys->frames * (CLOCK_FREQ / 2) / sys->rate);
vlc_tick_sleep(sys->frames * (CLOCK_FREQ / 2) / sys->rate);
}
IAudioRenderClient_Release(render);
out:
......
......@@ -370,7 +370,7 @@ static void Play( audio_output_t *p_aout, block_t *block, vlc_tick_t date )
{
msg_Warn( p_aout, "Couln't write frame... sleeping");
msleep( block->i_length );
vlc_tick_sleep( block->i_length );
}
WaveOutClean( sys );
......
......@@ -173,7 +173,7 @@ int va_pool_Get(va_pool_t *va_pool, picture_t *pic)
return VLC_ENOITEM;
/* Pool empty. Wait for some time as in src/input/decoder.c.
* XXX: Both this and the core should use a semaphore or a CV. */
msleep(VOUT_OUTMEM_SLEEP);
vlc_tick_sleep(VOUT_OUTMEM_SLEEP);
}
pic->context = field;
return VLC_SUCCESS;
......
......@@ -112,7 +112,7 @@ void gst_vlc_dec_ensure_empty_queue( decoder_t *p_dec )
while( p_sys->b_running && i_count < 60 &&
gst_atomic_queue_length( p_sys->p_que ))
{
msleep ( 15000 );
vlc_tick_sleep ( 15000 );
i_count++;
}
......
......@@ -835,7 +835,7 @@ static async_task_t *encode_frame(encoder_t *enc, picture_t *pic)
if (sys->busy_warn_counter++ % 16 == 0)
msg_Dbg(enc, "Device is busy, let's wait and retry %d", sts);
if (sts == MFX_WRN_DEVICE_BUSY)
msleep(QSV_BUSYWAIT_TIME);
vlc_tick_sleep(QSV_BUSYWAIT_TIME);
}
// msg_Dbg(enc, "Encode async status: %d, Syncpoint = %tx", sts, (ptrdiff_t)task->syncp);
......
......@@ -137,7 +137,7 @@ static void *RunIntf( void *data )
/* Wait a bit, get orientation, change filter if necessary */
#warning FIXME: check once (or less) per picture, not once per interval
msleep( INTF_IDLE_SLEEP );
vlc_tick_sleep( INTF_IDLE_SLEEP );
int canc = vlc_savecancel();
int i_x = motion_get_angle( p_intf->p_sys->p_motion );
......
......@@ -268,7 +268,7 @@ static void *Slave(void *handle)
vlc_restorecancel(canc);
}
wait:
msleep(INTF_IDLE_SLEEP);
vlc_tick_sleep(INTF_IDLE_SLEEP);
}
return NULL;
}
......
......@@ -1859,7 +1859,7 @@ bool ReadCommand( intf_thread_t *p_intf, char *p_buffer, int *pi_size )
return ReadWin32( p_intf, (unsigned char*)p_buffer, pi_size );
else if( p_intf->p_sys->i_socket == -1 )
{
msleep( INTF_IDLE_SLEEP );
vlc_tick_sleep( INTF_IDLE_SLEEP );
return false;
}
#endif
......
......@@ -300,7 +300,7 @@ void PlaylistManager::drain()
if(b_drained)
break;
msleep(20*1000); /* ugly, but we have no way to get feedback */
vlc_tick_sleep(20*1000); /* ugly, but we have no way to get feedback */
}
es_out_Control(p_demux->out, ES_OUT_RESET_PCR);
}
......
......@@ -1186,7 +1186,7 @@ static int Demux_Seekable( demux_t *p_demux )
* affect the reading speed too much. */
if( !(++i_loop_count % 1024) )
{
msleep( VLC_HARD_MIN_SLEEP );
vlc_tick_sleep( VLC_HARD_MIN_SLEEP );
if( !(i_loop_count % (1024 * 10)) )
msg_Warn( p_demux,
......@@ -1919,7 +1919,7 @@ static int AVI_StreamChunkFind( demux_t *p_demux, unsigned int i_stream )
* affect the reading speed too much. */
if( !(++i_loop_count % 1024) )
{
msleep( VLC_HARD_MIN_SLEEP );
vlc_tick_sleep( VLC_HARD_MIN_SLEEP );
if( !(i_loop_count % (1024 * 10)) )
msg_Warn( p_demux, "don't seem to find any data..." );
......@@ -2338,7 +2338,7 @@ static int AVI_PacketSearch( demux_t *p_demux )
* this code is called only on broken files). */
if( !(++i_count % 1024) )
{
msleep( VLC_HARD_MIN_SLEEP );
vlc_tick_sleep( VLC_HARD_MIN_SLEEP );
if( !(i_count % (1024 * 10)) )
msg_Warn( p_demux, "trying to resync..." );
}
......
......@@ -223,7 +223,7 @@ static int DemuxHEIF( demux_t *p_demux )
es_out_Control( p_demux->out, ES_OUT_GET_EMPTY, &b_empty );
if( !b_empty || mdate() <= p_sys->i_end_display_time )
{
msleep( 40 * 1000 );
vlc_tick_sleep( 40 * 1000 );
return VLC_DEMUXER_SUCCESS;
}
p_sys->i_end_display_time = 0;
......
......@@ -100,7 +100,7 @@ static int Lock(vlc_va_t *va, picture_t *pic, uint8_t **data)
return VLC_ENOMEM;
/* Pool empty. Wait for some time as in src/input/decoder.c.
* XXX: Both this and the core should use a semaphore or a CV. */
msleep(VOUT_OUTMEM_SLEEP);
vlc_tick_sleep(VOUT_OUTMEM_SLEEP);
}
pic->context = &field->context;
......
......@@ -336,7 +336,7 @@ static void *Run( void *opaque )
/* main loop */
for (;;)
{
msleep( CLOCK_FREQ );
vlc_tick_sleep( CLOCK_FREQ );
QueueIncomingRequests( p_sys );
......
......@@ -166,11 +166,11 @@ static void *Run( void *data )
vlc_restorecancel(canc);
if( i_status == 2 )
{
msleep( 5*CLOCK_FREQ );
vlc_tick_sleep( 5*CLOCK_FREQ );
i_status = 0;
}
else
msleep( CLOCK_FREQ/2 );
vlc_tick_sleep( CLOCK_FREQ/2 );
}
return NULL;
}
......
......@@ -710,7 +710,7 @@ static void* update_request_thread( void *obj )
interval *= 1000; /* ms -> µs */
do
msleep( interval );
vlc_tick_sleep( interval );
while( write_update_request( p_filter, true ) );
return NULL;
......
......@@ -302,7 +302,7 @@ static decklink_sys_t *HoldDLSys(vlc_object_t *obj, int i_cat)
{
vlc_mutex_unlock(&sys_lock);
msg_Info(obj, "Waiting for previous vout module to exit");
msleep(CLOCK_FREQ / 10);
vlc_tick_sleep(CLOCK_FREQ / 10);
vlc_mutex_lock(&sys_lock);
}
}
......@@ -1094,7 +1094,7 @@ static void Flush (audio_output_t *aout, bool drain)
if (drain) {
uint32_t samples;
sys->p_output->GetBufferedAudioSampleFrameCount(&samples);
msleep(CLOCK_FREQ * samples / sys->i_rate);
vlc_tick_sleep(CLOCK_FREQ * samples / sys->i_rate);
} else if (sys->p_output->FlushBufferedAudioSamples() == E_FAIL)
msg_Err(aout, "Flush failed");
}
......
......@@ -541,11 +541,11 @@ void vlc_tick_wait (vlc_tick_t deadline)
{
deadline -= mdate ();
if (deadline > 0)
msleep (deadline);
vlc_tick_sleep (deadline);
}
#undef msleep
void msleep (vlc_tick_t delay)
#undef vlc_tick_sleep
void vlc_tick_sleep (vlc_tick_t delay)
{
struct timespec ts = mtime_to_ts (delay);
......
......@@ -581,7 +581,7 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
if( p_vout )
break;
msleep( DECODER_SPU_VOUT_WAIT_DURATION );
vlc_tick_sleep( DECODER_SPU_VOUT_WAIT_DURATION );
}
if( !p_vout )
......
......@@ -2155,7 +2155,7 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es )
break;
/* FIXME there should be a way to have auto deleted es, but there will be
* a problem when another codec of the same type is created (mainly video) */
msleep( CLOCK_FREQ/50 );
vlc_tick_sleep( CLOCK_FREQ/50 );
}
EsUnselect( out, es, es->p_pgrm == p_sys->p_pgrm );
}
......
......@@ -271,7 +271,7 @@ vlc_obj_malloc
vlc_obj_calloc
vlc_obj_strdup
vlc_obj_free
msleep
vlc_tick_sleep
vlc_tick_wait
net_Accept
net_AcceptSingle
......
......@@ -96,7 +96,7 @@ void (vlc_tick_wait)(vlc_tick_t deadline)
vlc_cancel_addr_finish(&value);
}
void (msleep)(vlc_tick_t delay)
void (vlc_tick_sleep)(vlc_tick_t delay)
{
vlc_tick_wait(mdate() + delay);
}
......
......@@ -929,8 +929,8 @@ void vlc_tick_wait (vlc_tick_t deadline)
}
}
#undef msleep
void msleep (vlc_tick_t delay)
#undef vlc_tick_sleep
void vlc_tick_sleep (vlc_tick_t delay)
{
vlc_tick_wait (mdate () + delay);
}
......
......@@ -604,8 +604,8 @@ void vlc_tick_wait (vlc_tick_t deadline)
while (clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL) == EINTR);
}
#undef msleep
void msleep (vlc_tick_t delay)
#undef vlc_tick_sleep
void vlc_tick_sleep (vlc_tick_t delay)
{
struct timespec ts = mtime_to_ts (delay);
......
......@@ -28,7 +28,7 @@
#include <assert.h>
#include <vlc_common.h>
#undef msleep
#undef vlc_tick_sleep
struct timer_data
{
......
......@@ -793,7 +793,7 @@ void (vlc_tick_wait)(vlc_tick_t deadline)
}
}
void (msleep)(vlc_tick_t delay)
void (vlc_tick_sleep)(vlc_tick_t delay)
{
vlc_tick_wait (mdate () + delay);
}
......
......@@ -163,7 +163,7 @@ static void test_input_metadata_timeout(libvlc_instance_t *vlc, int timeout,
if (wait_and_cancel > 0)
{
msleep(wait_and_cancel * 1000);
vlc_tick_sleep(wait_and_cancel * 1000);
libvlc_MetadataCancel(vlc->p_libvlc_int, vlc);
}
......
......@@ -23,7 +23,7 @@
#include "test.h"
// For msleep
// For vlc_tick_sleep
#include <vlc_common.h>
#include <vlc_tick.h>
......
......@@ -207,7 +207,7 @@ test_dialogs(vlc_object_t *p_obj, struct cb_answer *p_ans,
"Indeterminate non cancellable dialog "
"for %" PRId64 " us", i_dialog_wait);
assert(p_id != NULL);
msleep(i_dialog_wait);
vlc_tick_sleep(i_dialog_wait);
vlc_dialog_release(p_obj, p_id);
assert(i_ret == VLC_SUCCESS);
......@@ -220,7 +220,7 @@ test_dialogs(vlc_object_t *p_obj, struct cb_answer *p_ans,
"Cancel It!");
assert(p_id != NULL);
while(!vlc_dialog_is_cancelled(p_obj, p_id))
msleep(i_dialog_wait / 30);
vlc_tick_sleep(i_dialog_wait / 30);
vlc_dialog_release(p_obj, p_id);
set_answer(p_ans, false, NULL, 0);
......@@ -229,7 +229,7 @@ test_dialogs(vlc_object_t *p_obj, struct cb_answer *p_ans,
assert(p_id != NULL);
while (f_position <= 1.0f)
{
msleep(i_dialog_wait / 30);
vlc_tick_sleep(i_dialog_wait / 30);
f_position += 0.02f;
i_ret = vlc_dialog_update_progress(p_obj, p_id, f_position);
assert(i_ret == VLC_SUCCESS);
......@@ -244,7 +244,7 @@ test_dialogs(vlc_object_t *p_obj, struct cb_answer *p_ans,
assert(p_id != NULL);
while (f_position <= 1.0f)
{
msleep(i_dialog_wait / 30);
vlc_tick_sleep(i_dialog_wait / 30);
f_position += 0.02f;
i_ret = vlc_dialog_update_progress_text(p_obj, p_id, f_position,
"Non cancellable dialog in progress.\n"
......@@ -274,7 +274,7 @@ test_dialogs(vlc_object_t *p_obj, struct cb_answer *p_ans,
"Error");
assert(i_ret == 0);
while(!vlc_dialog_is_cancelled(p_obj, p_id))
msleep(i_dialog_wait / 30);
vlc_tick_sleep(i_dialog_wait / 30);
vlc_dialog_release(p_obj, p_id);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment