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

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


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

ogg: provide test-and-clear-flags control

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

 modules/demux/ogg.c | 13 ++++++++++---
 modules/demux/ogg.h |  1 +
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 496354d654..e9f05099d1 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -957,13 +957,20 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                 Ogg_ResetStreamsHelper( p_sys );
                 es_out_Control( p_demux->out, ES_OUT_SET_NEXT_DISPLAY_TIME,
                                 VLC_TS_0 + i64 );
-                p_demux->info.i_update |= INPUT_UPDATE_SEEKPOINT;
+                p_sys->updates |= INPUT_UPDATE_SEEKPOINT;
                 p_sys->cur_seekpoint = i_seekpoint;
                 return VLC_SUCCESS;
             }
             else
                 return VLC_EGENERIC;
         }
+        case DEMUX_TEST_AND_CLEAR_FLAGS:
+        {
+            unsigned *restrict flags = va_arg( args, unsigned * );
+            *flags &= p_sys->updates;
+            p_sys->updates = ~*flags;
+            return VLC_SUCCESS;
+        }
         case DEMUX_GET_TITLE:
             *va_arg( args, int * ) = 0;
             return VLC_SUCCESS;
@@ -2527,7 +2534,7 @@ static void Ogg_ExtractComments( demux_t *p_demux, es_format_t *p_fmt,
 
     if( p_ogg->i_seekpoints > 1 )
     {
-        p_demux->info.i_update |= INPUT_UPDATE_TITLE_LIST;
+        p_ogg->updates |= INPUT_UPDATE_TITLE_LIST;
     }
 }
 
@@ -2610,7 +2617,7 @@ static void Ogg_ExtractMeta( demux_t *p_demux, es_format_t *p_fmt, const uint8_t
         break;
     }
     if( p_ogg->p_meta )
-        p_demux->info.i_update |= INPUT_UPDATE_META;
+        p_ogg->updates |= INPUT_UPDATE_META;
 }
 
 static bool Ogg_ReadTheoraHeader( logical_stream_t *p_stream,
diff --git a/modules/demux/ogg.h b/modules/demux/ogg.h
index c25f8c5252..bed61065a2 100644
--- a/modules/demux/ogg.h
+++ b/modules/demux/ogg.h
@@ -214,6 +214,7 @@ struct demux_sys_t
     int                 cur_seekpoint;
     int                 i_seekpoints;
     seekpoint_t         **pp_seekpoints;
+    unsigned            updates;
 
     /* skeleton */
     struct



More information about the vlc-commits mailing list