[vlc-commits] input: add input_source_IsCatAutoselected
Thomas Guillem
git at videolan.org
Fri Feb 28 20:46:55 CET 2020
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Feb 28 14:07:14 2020 +0100| [0f2e774ba145aa1f7d66d1f837dc669f9ceb2597] | committer: Thomas Guillem
input: add input_source_IsCatAutoselected
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0f2e774ba145aa1f7d66d1f837dc669f9ceb2597
---
src/input/input.c | 9 +++++++++
src/input/input_internal.h | 7 +++++++
2 files changed, 16 insertions(+)
diff --git a/src/input/input.c b/src/input/input.c
index 4955a499aa..c40d79d48e 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -2821,6 +2821,12 @@ int input_source_GetNewAutoId( input_source_t *in )
return in->auto_id++;
}
+bool input_source_IsCatAutoselected( input_source_t *in,
+ enum es_format_category_e cat )
+{
+ return in->autoselect_cats[cat];
+}
+
/*****************************************************************************
* InputSourceDestroy:
*****************************************************************************/
@@ -3379,6 +3385,9 @@ static int input_SlaveSourceAdd( input_thread_t *p_input,
if( !p_source )
return VLC_EGENERIC;
+ if( b_forced )
+ p_source->autoselect_cats[i_cat] = true;
+
int ret = InputSourceInit( p_source, p_input, psz_uri,
psz_forced_demux,
b_can_fail || psz_forced_demux );
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index 324f891eb8..18dead6d1a 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -379,6 +379,7 @@ struct input_source_t
char *str_id;
int auto_id;
+ bool autoselect_cats[ES_CATEGORY_COUNT];
/* Title infos for that input */
bool b_title_demux; /* Titles/Seekpoints provided by demux */
@@ -677,6 +678,12 @@ const char *input_source_GetStrId( input_source_t *in );
*/
int input_source_GetNewAutoId( input_source_t *in );
+/**
+ * Returns true if a category should be auto-selected for a given source
+ */
+bool input_source_IsCatAutoselected( input_source_t *in,
+ enum es_format_category_e cat );
+
/* Bound pts_delay */
#define INPUT_PTS_DELAY_MAX VLC_TICK_FROM_SEC(60)
More information about the vlc-commits
mailing list