[vlc-commits] input/es_out: add function EsInfoCategoryName

Filip Roséen git at videolan.org
Mon Jul 18 05:57:59 CEST 2016


vlc | branch: master | Filip Roséen <filip at videolabs.io> | Wed Jul 13 22:41:52 2016 +0200| [d34da85adbe24de14be6fb679a6c148af6ef178b] | committer: Jean-Baptiste Kempf

input/es_out: add function EsInfoCategoryName

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.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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;



More information about the vlc-commits mailing list