[vlc-commits] demux: always use DEMUX_GET_(TITLE|SEEKPOINT)

Rémi Denis-Courmont git at videolan.org
Sun Dec 3 13:27:29 CET 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec  3 12:18:21 2017 +0200| [b4279dc015d0becde4cf35f6ed21ef695801b65e] | committer: Rémi Denis-Courmont

demux: always use DEMUX_GET_(TITLE|SEEKPOINT)

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

 include/vlc_demux.h |  4 ++--
 src/input/demux.c   | 18 ++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index ebd9e4b78d..0d04bfd91f 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -218,14 +218,14 @@ enum demux_query_e
 
     /** Read the title number currently playing
      *
-     * Can fail, in which case demux_t.info.i_title is used
+     * Can fail.
      *
      * 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
+     * Can fail.
      *
      * arg1= int * */
     DEMUX_GET_SEEKPOINT,        /* arg1= int*           can fail */
diff --git a/src/input/demux.c b/src/input/demux.c
index f9f6924be5..fb28c5ed5d 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -562,18 +562,20 @@ 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 title;
+
+    if (demux_Control(p_demux, DEMUX_GET_TITLE, &title))
+        title = 0;
+    return 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;
+    int seekpoint;
+
+    if (demux_Control(p_demux, DEMUX_GET_SEEKPOINT, &seekpoint))
+        seekpoint = 0;
+    return seekpoint;
 }
 
 static demux_t *demux_FilterNew( demux_t *p_next, const char *p_name )



More information about the vlc-commits mailing list