[vlc-commits] input: source: add input_source_GetNewAutoId()

Thomas Guillem git at videolan.org
Fri Feb 28 20:46:08 CET 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Feb 26 15:15:03 2020 +0100| [834065f4318f5508fcd1d3e743a80e61122d3031] | committer: Thomas Guillem

input: source: add input_source_GetNewAutoId()

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

 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 f467ceb2a3..4b023d434d 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 0590d5bfe7..494966f6d5 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)
 



More information about the vlc-commits mailing list