[vlc-commits] demux: remove demux_sys_t.info
Rémi Denis-Courmont
git at videolan.org
Sun Jan 28 15:48:56 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jan 28 16:17:39 2018 +0200| [787c1cca0bbddb2abc55b7736deed2a4ef196ded] | committer: Rémi Denis-Courmont
demux: remove demux_sys_t.info
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=787c1cca0bbddb2abc55b7736deed2a4ef196ded
---
include/vlc_demux.h | 12 +-----------
modules/demux/filter/noseek.c | 6 +-----
modules/stream_out/chromecast/chromecast_demux.cpp | 1 -
src/input/demux.c | 8 ++------
test/src/input/demux-run.c | 8 +++-----
5 files changed, 7 insertions(+), 28 deletions(-)
diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index e49d4a54a3..ff55287fe9 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -81,13 +81,6 @@ struct demux_t
int (*pf_demux) ( demux_t * ); /* demux one frame only */
int (*pf_control)( demux_t *, int i_query, va_list args);
- /* Demux has to maintain them uptodate
- * when it is responsible of seekpoint/title */
- struct
- {
- unsigned int i_update; /* Demux sets them on change,
- Input removes them once take into account*/
- } info;
void *p_sys;
/* Weak link to parent input */
@@ -99,7 +92,7 @@ struct demux_t
#define VLC_DEMUXER_EGENERIC -1
#define VLC_DEMUXER_SUCCESS 1
-/* demux_t.info.i_update field */
+/* DEMUX_TEST_AND_CLEAR flags */
#define INPUT_UPDATE_TITLE 0x0010
#define INPUT_UPDATE_SEEKPOINT 0x0020
#define INPUT_UPDATE_META 0x0040
@@ -207,9 +200,6 @@ enum demux_query_e
* The unsigned* argument is set with the flags needed to be checked,
* on return it contains the values that were reset during the call
*
- * This can can fail, in which case flags from demux_t.info.i_update
- * are read/reset
- *
* arg1= unsigned * */
DEMUX_TEST_AND_CLEAR_FLAGS, /* arg1= unsigned* can fail */
diff --git a/modules/demux/filter/noseek.c b/modules/demux/filter/noseek.c
index ab72fe8595..23ae9f2d45 100644
--- a/modules/demux/filter/noseek.c
+++ b/modules/demux/filter/noseek.c
@@ -49,11 +49,7 @@ static int Control(demux_t *demux, int query, va_list args)
unsigned *restrict pf = va_arg(args, unsigned *);
if (demux_Control(demux->p_next, DEMUX_TEST_AND_CLEAR_FLAGS, pf))
- {
- unsigned update = demux->info.i_update & *pf;
- demux->info.i_update &= ~*pf;
- *pf = update;
- }
+ *pf = 0;
*pf &= ~(INPUT_UPDATE_TITLE|INPUT_UPDATE_SEEKPOINT|
INPUT_UPDATE_TITLE_LIST);
break;
diff --git a/modules/stream_out/chromecast/chromecast_demux.cpp b/modules/stream_out/chromecast/chromecast_demux.cpp
index 5ef74f2153..ff4e2b319f 100644
--- a/modules/stream_out/chromecast/chromecast_demux.cpp
+++ b/modules/stream_out/chromecast/chromecast_demux.cpp
@@ -97,7 +97,6 @@ struct demux_sys_t
{
demux_Control( p_demux->p_next, DEMUX_SET_TITLE,
i_longest_title );
- p_demux->info.i_update = p_demux->p_next->info.i_update;
}
}
}
diff --git a/src/input/demux.c b/src/input/demux.c
index 5484b1291e..d78103ee31 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -243,7 +243,6 @@ demux_t *demux_NewAdvanced( vlc_object_t *p_obj, input_thread_t *p_parent_input,
p_demux->pf_demux = NULL;
p_demux->pf_control = NULL;
p_demux->p_sys = NULL;
- p_demux->info.i_update = 0;
priv->destroy = s ? demux_DestroyDemux : demux_DestroyAccessDemux;
if( s != NULL )
@@ -493,11 +492,8 @@ unsigned demux_TestAndClearFlags( demux_t *p_demux, unsigned flags )
{
unsigned update = flags;
- if ( demux_Control( p_demux, DEMUX_TEST_AND_CLEAR_FLAGS, &update ) == VLC_SUCCESS )
- return update;
-
- update = p_demux->info.i_update & flags;
- p_demux->info.i_update &= ~flags;
+ if (demux_Control( p_demux, DEMUX_TEST_AND_CLEAR_FLAGS, &update))
+ return 0;
return update;
}
diff --git a/test/src/input/demux-run.c b/test/src/input/demux-run.c
index ba110049c5..5f5efa59dd 100644
--- a/test/src/input/demux-run.c
+++ b/test/src/input/demux-run.c
@@ -219,11 +219,9 @@ static es_out_t *test_es_out_create(vlc_object_t *parent)
static unsigned demux_test_and_clear_flags(demux_t *demux, unsigned flags)
{
unsigned update;
- if (demux_Control(demux, DEMUX_TEST_AND_CLEAR_FLAGS, &update) == VLC_SUCCESS)
- return update;
- unsigned ret = demux->info.i_update & flags;
- demux->info.i_update &= ~flags;
- return ret;
+ if (demux_Control(demux, DEMUX_TEST_AND_CLEAR_FLAGS, &update))
+ return 0;
+ return update;
}
static void demux_get_title_list(demux_t *demux)
More information about the vlc-commits
mailing list