Thus, there is no need for a mutex anymore.
+ /* All owned by timer thread while timer is armed: */
xcb_connection_t *conn;
es_out_id_t *es;
mtime_t pts, interval;
xcb_connection_t *conn;
es_out_id_t *es;
mtime_t pts, interval;
uint16_t w, h;
uint16_t cur_w, cur_h;
bool follow_mouse;
uint16_t w, h;
uint16_t cur_w, cur_h;
bool follow_mouse;
- /* fmt, es and pts are protected by the lock. The rest is read-only. */
- vlc_mutex_t lock;
/* Timer does not use this, only input thread: */
vlc_timer_t timer;
};
/* Timer does not use this, only input thread: */
vlc_timer_t timer;
};
p_sys->cur_h = 0;
p_sys->es = NULL;
p_sys->pts = VLC_TS_INVALID;
p_sys->cur_h = 0;
p_sys->es = NULL;
p_sys->pts = VLC_TS_INVALID;
- vlc_mutex_init (&p_sys->lock);
if (vlc_timer_create (&p_sys->timer, Demux, demux))
goto error;
vlc_timer_schedule (p_sys->timer, false, 1, p_sys->interval);
if (vlc_timer_create (&p_sys->timer, Demux, demux))
goto error;
vlc_timer_schedule (p_sys->timer, false, 1, p_sys->interval);
demux_sys_t *p_sys = demux->p_sys;
vlc_timer_destroy (p_sys->timer);
demux_sys_t *p_sys = demux->p_sys;
vlc_timer_destroy (p_sys->timer);
- vlc_mutex_destroy (&p_sys->lock);
xcb_disconnect (p_sys->conn);
free (p_sys);
}
xcb_disconnect (p_sys->conn);
free (p_sys);
}
*/
static int Control (demux_t *demux, int query, va_list args)
{
*/
static int Control (demux_t *demux, int query, va_list args)
{
- demux_sys_t *p_sys = demux->p_sys;
-
switch (query)
{
case DEMUX_GET_POSITION:
switch (query)
{
case DEMUX_GET_POSITION:
{
bool *v = (bool*)va_arg( args, bool * );
{
bool *v = (bool*)va_arg( args, bool * );
- *v = true;
- return VLC_SUCCESS;
- }
-
- case DEMUX_SET_PAUSE_STATE:
- {
- bool pausing = va_arg (args, int);
-
- if (!pausing)
- {
- vlc_mutex_lock (&p_sys->lock);
- p_sys->pts = VLC_TS_INVALID;
- es_out_Control (demux->out, ES_OUT_RESET_PCR);
- vlc_mutex_unlock (&p_sys->lock);
- }
- vlc_timer_schedule (p_sys->timer, false,
- pausing ? 0 : 1, p_sys->interval);
case DEMUX_CAN_CONTROL_PACE:
case DEMUX_CAN_CONTROL_RATE:
case DEMUX_CAN_SEEK:
case DEMUX_CAN_CONTROL_PACE:
case DEMUX_CAN_CONTROL_RATE:
case DEMUX_CAN_SEEK:
*v = false;
return VLC_SUCCESS;
}
*v = false;
return VLC_SUCCESS;
}
+
+ case DEMUX_SET_PAUSE_STATE:
+ return VLC_SUCCESS; /* should not happen */
return;
/* Update elementary stream format (if needed) */
return;
/* Update elementary stream format (if needed) */
- vlc_mutex_lock (&p_sys->lock);
if (w != p_sys->cur_w || h != p_sys->cur_h)
{
if (p_sys->es != NULL)
if (w != p_sys->cur_w || h != p_sys->cur_h)
{
if (p_sys->es != NULL)
es_out_Send (demux->out, p_sys->es, block);
p_sys->pts += p_sys->interval;
}
es_out_Send (demux->out, p_sys->es, block);
p_sys->pts += p_sys->interval;
}
- vlc_mutex_unlock (&p_sys->lock);
}
static es_out_id_t *InitES (demux_t *demux, uint_fast16_t width,
}
static es_out_id_t *InitES (demux_t *demux, uint_fast16_t width,