Commit be3414d0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

sid: provide test-and-clear-flags control

parent fc3f7c4a
......@@ -71,6 +71,7 @@ struct demux_sys_t
date_t pts;
int last_title;
bool title_changed;
};
......@@ -279,12 +280,23 @@ static int Control (demux_t *demux, int query, va_list args)
return VLC_EGENERIC;
sys->last_title = i_idx;
demux->info.i_update = INPUT_UPDATE_TITLE;
sys->title_changed = true;
msg_Dbg( demux, "set song %i", i_idx);
return VLC_SUCCESS;
}
case DEMUX_TEST_AND_CLEAR_FLAGS: {
unsigned *restrict flags = va_arg(args, unsigned *);
if ((*flags & INPUT_UPDATE_TITLE) && sys->title_changed) {
*flags = INPUT_UPDATE_TITLE;
sys->title_changed = false;
} else
*flags = 0;
return VLC_SUCCESS;
}
case DEMUX_GET_TITLE:
*va_arg(args, int *) = sys->last_title;
return VLC_SUCCESS;
......
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