[vlc-commits] avformat: provide test-and-clear-flags control

Rémi Denis-Courmont git at videolan.org
Sun Jan 28 15:18:31 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 17 21:44:23 2017 +0200| [f58bd7746a40c9ee5f6b180e20809fdbe478f4c8] | committer: Rémi Denis-Courmont

avformat: provide test-and-clear-flags control

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f58bd7746a40c9ee5f6b180e20809fdbe478f4c8
---

 modules/demux/avformat/demux.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 7074152918..6932462996 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -78,6 +78,7 @@ struct demux_sys_t
     /* Only one title with seekpoints possible atm. */
     input_title_t *p_title;
     int i_seekpoint;
+    unsigned i_update;
 };
 
 #define AVFORMAT_IOBUFFER_SIZE 32768  /* FIXME */
@@ -278,6 +279,7 @@ int avformat_OpenDemux( vlc_object_t *p_this )
     TAB_INIT( p_sys->i_attachments, p_sys->attachments);
     p_sys->p_title = NULL;
     p_sys->i_seekpoint = 0;
+    p_sys->i_update = 0;
 
     /* Create I/O wrapper */
     unsigned char * p_io_buffer = av_malloc( AVFORMAT_IOBUFFER_SIZE );
@@ -900,7 +902,7 @@ static void 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->i_update |= INPUT_UPDATE_SEEKPOINT;
     }
 }
 
@@ -1157,6 +1159,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             ResetTime( p_demux, i64 - i_start_time );
             return VLC_SUCCESS;
         }
+        case DEMUX_TEST_AND_CLEAR_FLAGS:
+        {
+            unsigned *restrict flags = va_arg(args, unsigned *);
+            *flags &= p_sys->i_update;
+            p_sys->i_update &= ~*flags;
+            return VLC_SUCCESS;
+        }
         case DEMUX_GET_TITLE:
             if( p_sys->p_title == NULL )
                 return VLC_EGENERIC;



More information about the vlc-commits mailing list