Commit 07e78801 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

clock: attach a logger

parent 67fe08b7
......@@ -30,6 +30,7 @@
struct vlc_clock_main_t
{
struct vlc_logger *logger;
vlc_mutex_t lock;
vlc_cond_t cond;
......@@ -359,13 +360,20 @@ void vlc_clock_Wait(vlc_clock_t *clock, vlc_tick_t system_now, vlc_tick_t ts,
vlc_mutex_unlock(&main_clock->lock);
}
vlc_clock_main_t *vlc_clock_main_New(void)
vlc_clock_main_t *vlc_clock_main_New(struct vlc_logger *parent_logger)
{
vlc_clock_main_t *main_clock = malloc(sizeof(vlc_clock_main_t));
if (main_clock == NULL)
return NULL;
main_clock->logger = vlc_LogHeaderCreate(parent_logger, "clock");
if (main_clock->logger == NULL)
{
free(main_clock);
return NULL;
}
vlc_mutex_init(&main_clock->lock);
vlc_cond_init(&main_clock->cond);
main_clock->input_master = main_clock->master = NULL;
......@@ -473,6 +481,7 @@ void vlc_clock_main_ChangePause(vlc_clock_main_t *main_clock, vlc_tick_t now,
void vlc_clock_main_Delete(vlc_clock_main_t *main_clock)
{
assert(main_clock->rc == 1);
vlc_LogDestroy(main_clock->logger);
free(main_clock);
}
......
......@@ -58,7 +58,7 @@ struct vlc_clock_cbs
/**
* This function creates the vlc_clock_main_t of the program
*/
vlc_clock_main_t *vlc_clock_main_New(void);
vlc_clock_main_t *vlc_clock_main_New(struct vlc_logger *parent_logger);
/**
* Destroy the clock main
......
......@@ -1455,7 +1455,7 @@ static es_out_pgrm_t *EsOutProgramAdd( es_out_t *out, input_source_t *source, in
p_pgrm->p_meta = NULL;
p_pgrm->active_clock_source = VLC_CLOCK_MASTER_AUTO;
p_pgrm->p_main_clock = vlc_clock_main_New();
p_pgrm->p_main_clock = vlc_clock_main_New( p_input->obj.logger );
if( !p_pgrm->p_main_clock )
{
free( p_pgrm );
......
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