vlc | branch: master | Steve Lhomme <[email protected]> | Tue Jun 14 08:45:14 2016 +0200| [9350aedb96b9748587ca8e590a22e4d4ff53a681] | committer: 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 <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9350aedb96b9748587ca8e590a22e4d4ff53a681 --- include/vlc_demux.h | 25 +++++++++++++++++++++++++ src/input/demux.c | 9 +++++++++ 2 files changed, 34 insertions(+) diff --git a/include/vlc_demux.h b/include/vlc_demux.h index a42998b..8f7ebec 100644 --- a/include/vlc_demux.h +++ b/include/vlc_demux.h @@ -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= */ diff --git a/src/input/demux.c b/src/input/demux.c index b159526..9d962f5 100644 --- a/src/input/demux.c +++ b/src/input/demux.c @@ -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; } _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
