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

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


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

sid: provide test-and-clear-flags control

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

 modules/demux/sid.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/modules/demux/sid.cpp b/modules/demux/sid.cpp
index f62138e37b..7c7795810c 100644
--- a/modules/demux/sid.cpp
+++ b/modules/demux/sid.cpp
@@ -71,6 +71,7 @@ struct demux_sys_t
     date_t pts;
 
     int last_title;
+    bool title_changed;
 };
 
 
@@ -279,12 +280,23 @@ static int Control (demux_t *demux, int query, va_list args)
                 return  VLC_EGENERIC;
 
             sys->last_title = i_idx;
-            demux->info.i_update = INPUT_UPDATE_TITLE;
+            sys->title_changed = true;
             msg_Dbg( demux, "set song %i", i_idx);
 
             return VLC_SUCCESS;
         }
 
+        case DEMUX_TEST_AND_CLEAR_FLAGS: {
+            unsigned *restrict flags = va_arg(args, unsigned *);
+
+            if ((*flags & INPUT_UPDATE_TITLE) && sys->title_changed) {
+                *flags = INPUT_UPDATE_TITLE;
+                p_sys->title_changed = false;
+            } else
+                *flags = 0;
+            return VLC_SUCCESS;
+        }
+
         case DEMUX_GET_TITLE:
             *va_arg(args, int *) = sys->last_title;
             return VLC_SUCCESS;



More information about the vlc-commits mailing list