[vlc-devel] [PATCH 8/8] input: source: add input_source_GetNewAutoId()

Thomas Guillem thomas at gllm.fr
Fri Feb 28 08:36:30 CET 2020


---
 src/input/input.c          |  5 +++++
 src/input/input_internal.h | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/src/input/input.c b/src/input/input.c
index f467ceb2a3d..4b023d434df 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2747,6 +2747,11 @@ const char *input_source_GetStrId( input_source_t *in )
     return in->str_id;
 }
 
+int input_source_GetNewAutoId( input_source_t *in )
+{
+    return in->auto_id++;
+}
+
 /*****************************************************************************
  * InputSourceDestroy:
  *****************************************************************************/
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index 0590d5bfe7d..494966f6d50 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -371,6 +371,7 @@ struct input_source_t
 
     demux_t  *p_demux; /**< Demux object (most downstream) */
     char *str_id;
+    int auto_id;
 
     /* Title infos for that input */
     bool         b_title_demux; /* Titles/Seekpoints provided by demux */
@@ -656,6 +657,15 @@ void input_source_Release( input_source_t *in );
  */
 const char *input_source_GetStrId( input_source_t *in );
 
+/**
+ * Get a new fmt.i_id from the input source
+ *
+ * This auto id will be relative to this input source. It allows to have stable
+ * ids across different playback instances, by not relying on the input source
+ * addition order.
+ */
+int input_source_GetNewAutoId( input_source_t *in );
+
 /* Bound pts_delay */
 #define INPUT_PTS_DELAY_MAX VLC_TICK_FROM_SEC(60)
 
-- 
2.20.1



More information about the vlc-devel mailing list