[vlc-devel] [PATCH 1/3] input/es_out: added function EsInfoCategoryName

Filip Roséen filip at videolabs.io
Wed Jul 13 22:41:52 CEST 2016


Given that we are generating a category-identifier that is to uniquely
identify a certain ES, it certainly make sense to introduce a helper.

The added function will aid readability, as well as making sure that the
string is always generated in the same way.
---
 src/input/es_out.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/input/es_out.c b/src/input/es_out.c
index bd01c3e..9fb8602 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -199,6 +199,7 @@ static char **LanguageSplit( const char *psz_langs, bool b_default_any );
 static int LanguageArrayIndex( char **ppsz_langs, const char *psz_lang );
 
 static char *EsOutProgramGetMetaName( es_out_pgrm_t *p_pgrm );
+static char *EsInfoCategoryName( es_out_id_t* es );
 
 static const vlc_fourcc_t EsOutFourccClosedCaptions[4] = {
     VLC_FOURCC('c', 'c', '1', ' '),
@@ -1157,6 +1158,16 @@ static char *EsOutProgramGetMetaName( es_out_pgrm_t *p_pgrm )
     return psz;
 }
 
+static char *EsInfoCategoryName( es_out_id_t* es )
+{
+    char *psz_category;
+
+    if( asprintf( &psz_category, _("Stream %d"), es->i_meta_id ) == -1 )
+        return NULL;
+
+    return psz_category;
+}
+
 static void EsOutProgramMeta( es_out_t *out, int i_group, const vlc_meta_t *p_meta )
 {
     es_out_sys_t      *p_sys = out->p_sys;
-- 
2.9.0



More information about the vlc-devel mailing list