[vlc-commits] mp4: provide test-and-clear-flags control
Rémi Denis-Courmont
git at videolan.org
Sun Jan 28 15:18:34 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 17 21:44:23 2017 +0200| [eed411b07bc5723621416d71649765dd86408f9e] | committer: Rémi Denis-Courmont
mp4: provide test-and-clear-flags control
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eed411b07bc5723621416d71649765dd86408f9e
---
modules/demux/mp4/mp4.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index c36e32b85a..85ed65b702 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -107,6 +107,7 @@ struct demux_sys_t
MP4_Box_t *p_tref_chap;
/* */
+ bool seekpoint_changed;
int i_seekpoint;
input_title_t *p_title;
vlc_meta_t *p_meta;
@@ -1461,7 +1462,7 @@ static void MP4_UpdateSeekpoint( demux_t *p_demux, int64_t i_time )
if( i != p_sys->i_seekpoint && i >= 0 )
{
p_sys->i_seekpoint = i;
- p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
+ p_sys->seekpoint_changed = true;
}
}
/*****************************************************************************
@@ -2119,6 +2120,20 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_EGENERIC;
return Seek( p_demux, p_sys->p_title->seekpoint[i_seekpoint]->i_time_offset, true );
}
+ case DEMUX_TEST_AND_CLEAR_FLAGS:
+ {
+ unsigned *restrict flags = va_arg( args, unsigned * );
+
+ if ((*flags & INPUT_UPDATE_SEEKPOINT) && p_sys->seekpoint_changed)
+ {
+ *flags = INPUT_UPDATE_SEEKPOINT;
+ p_sys->seekpoint_changed = false;
+ }
+ else
+ *flags = 0;
+ return VLC_SUCCESS;
+ }
+
case DEMUX_GET_PTS_DELAY:
{
for( unsigned int i = 0; i < p_sys->i_tracks; i++ )
More information about the vlc-commits
mailing list