Commit 9350aedb authored by Steve Lhomme's avatar Steve Lhomme Committed by Thomas Guillem

demux: add control calls to read the demuxer title/seekpoint

this is necessary to go through (coming) demux filters
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent e5660d61
......@@ -189,6 +189,31 @@ enum demux_query_e
* arg1= int */
DEMUX_SET_SEEKPOINT, /* arg1= int can fail */
/** Check which INPUT_UPDATE_XXX flag is set and reset the ones set.
*
* The unsigned* argument is set with the flags needed to be checked,
* on return it contains the values that were reset during the call
*
* This can can fail, in which case flags from demux_t.info.i_update
* are read/reset
*
* arg1= unsigned * */
DEMUX_TEST_AND_CLEAR_FLAGS, /* arg1= unsigned* can fail */
/** Read the title number currently playing
*
* Can fail, in which case demux_t.info.i_title is used
*
* arg1= int * */
DEMUX_GET_TITLE, /* arg1= int* can fail */
/* Read the seekpoint/chapter currently playing
*
* Can fail, in which case demux_t.info.i_seekpoint is used
*
* arg1= int * */
DEMUX_GET_SEEKPOINT, /* arg1= int* can fail */
/* I. Common queries to access_demux and demux */
/* POSITION double between 0.0 and 1.0 */
DEMUX_GET_POSITION = 0x300, /* arg1= double * res= */
......
......@@ -659,6 +659,9 @@ static bool SkipAPETag( demux_t *p_demux )
unsigned demux_TestAndClearFlags( demux_t *p_demux, unsigned flags )
{
unsigned i_update;
if ( demux_Control( p_demux, DEMUX_TEST_AND_CLEAR_FLAGS, &i_update ) == VLC_SUCCESS )
return i_update;
unsigned ret = p_demux->info.i_update & flags;
p_demux->info.i_update &= ~flags;
return ret;
......@@ -666,10 +669,16 @@ unsigned demux_TestAndClearFlags( demux_t *p_demux, unsigned flags )
int demux_GetTitle( demux_t *p_demux )
{
int i_title;
if ( demux_Control( p_demux, DEMUX_GET_TITLE, &i_title ) == VLC_SUCCESS )
return i_title;
return p_demux->info.i_title;
}
int demux_GetSeekpoint( demux_t *p_demux )
{
int i_seekpoint;
if ( demux_Control( p_demux, DEMUX_GET_SEEKPOINT, &i_seekpoint ) == VLC_SUCCESS )
return i_seekpoint;
return p_demux->info.i_seekpoint;
}
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