demux: ts: use defines for descriptions
authorFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 19 Jul 2018 07:53:09 +0000 (09:53 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 19 Jul 2018 09:07:34 +0000 (11:07 +0200)
modules/demux/mpeg/ts_descriptions.h [new file with mode: 0644]
modules/demux/mpeg/ts_psi.c
po/POTFILES.in

diff --git a/modules/demux/mpeg/ts_descriptions.h b/modules/demux/mpeg/ts_descriptions.h
new file mode 100644 (file)
index 0000000..3d514e6
--- /dev/null
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * ts_desciptions.c: es description strings
+ *****************************************************************************
+ * Copyright (C) 2004-2016 VLC authors and VideoLAN
+ *                    2018 VideoLabs
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *****************************************************************************/
+#ifndef TS_DESCRIPTIONS
+#define TS_DESCRIPTIONS
+
+/* Audio tracks descriptions */
+#define DESC_CLEAN_EFFECTS                  N_("clean effects")
+#define DESC_HEARING_IMPAIRED               N_("hearing impaired")
+#define DESC_VISUAL_IMPAIRED_COMMENTS       N_("visual impaired commentary")
+
+#define DESC_MAIN_AUDIO                     N_("Main audio")
+#define DESC_AUDIO_DESC_VISUALLY_IMPAIRED   N_("Audio description for the visually impaired")
+#define DESC_CLEAN_AUDIO_HEARING_IMPAIRED   N_("Clean audio for the hearing impaired")
+#define DESC_SPOKEN_SUBTITLES_VISUAL_IMP    N_("Spoken subtitles for the visually impaired")
+
+/* SPU tracks descriptions */
+#define DESC_TELETEXT                       N_("Teletext")
+#define DESC_TELETEXT_SUBTITLES             N_("Teletext subtitles")
+#define DESC_TELETEXT_ADDTNL_INFO           N_("Teletext: additional information")
+#define DESC_TELETEXT_SCHEDULE              N_("Teletext: program schedule")
+#define DESC_TELETEXT_SUBS_HEARING_IMPAIRED N_("Teletext subtitles: hearing impaired")
+
+
+#endif
index 74325e3..4da3a48 100644 (file)
@@ -54,6 +54,7 @@
 #include "ts_psip.h"
 #include "ts_si.h"
 #include "ts_metadata.h"
+#include "ts_descriptions.h"
 
 #include "../access/dtv/en50221_capmt.h"
 
@@ -421,10 +422,10 @@ static void SetupAudioExtendedDescriptors( demux_t *p_demux, ts_es_t *p_es,
         if( p_dr && p_dr->i_length > 1 && p_dr->p_data[0] == 0x06 /* Tag extension */ )
         {
             static const char *editorial_classification_coding[] = {
-                N_("Main audio"),
-                N_("Audio description for the visually impaired"),
-                N_("Clean audio for the hearing impaired"),
-                N_("Spoken subtitles for the visually impaired"),
+                DESC_MAIN_AUDIO,
+                DESC_AUDIO_DESC_VISUALLY_IMPAIRED,
+                DESC_CLEAN_AUDIO_HEARING_IMPAIRED,
+                DESC_SPOKEN_SUBTITLES_VISUAL_IMP,
             };
 
             uint8_t i_audio_type = (p_dr->p_data[1] & 0x7F) >> 2;
@@ -460,9 +461,9 @@ static char *GetIso639AudioTypeDesc( uint8_t type )
 {
     static const char *audio_type[] = {
         /* "Main audio", */
-        N_("clean effects"),
-        N_("hearing impaired"),
-        N_("visual impaired commentary"),
+        DESC_CLEAN_EFFECTS,
+        DESC_HEARING_IMPAIRED,
+        DESC_VISUAL_IMPAIRED_COMMENTS,
     };
 
     if ( type == 0 || type >= ARRAY_SIZE(audio_type) )
@@ -695,11 +696,11 @@ typedef struct
 
 static const char *const ppsz_teletext_type[] = {
  "",
N_("Teletext"),
N_("Teletext subtitles"),
N_("Teletext: additional information"),
N_("Teletext: program schedule"),
- N_("Teletext subtitles: hearing impaired")
DESC_TELETEXT,
DESC_TELETEXT_SUBTITLES,
DESC_TELETEXT_ADDTNL_INFO,
DESC_TELETEXT_SCHEDULE,
+ DESC_TELETEXT_SUBS_HEARING_IMPAIRED
 };
 
 static void PMTSetupEsTeletext( demux_t *p_demux, ts_stream_t *p_pes,
index 0e69ba8..e2c4251 100644 (file)
@@ -407,7 +407,7 @@ modules/demux/mpeg/h26x.c
 modules/demux/mpeg/mpgv.c
 modules/demux/mpeg/ps.c
 modules/demux/mpeg/ts.c
-modules/demux/mpeg/ts_psi.c
+modules/demux/mpeg/ts_descriptions.h
 modules/demux/nsc.c
 modules/demux/nsv.c
 modules/demux/nuv.c