[vlc-commits] demux: ts: use defines for descriptions

Francois Cartegnie git at videolan.org
Thu Jul 19 11:08:44 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jul 19 09:53:09 2018 +0200| [85ddf83b526a87817a9585ee2cfd8b821a0299ba] | committer: Francois Cartegnie

demux: ts: use defines for descriptions

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

 modules/demux/mpeg/ts_descriptions.h | 41 ++++++++++++++++++++++++++++++++++++
 modules/demux/mpeg/ts_psi.c          | 25 +++++++++++-----------
 po/POTFILES.in                       |  2 +-
 3 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/modules/demux/mpeg/ts_descriptions.h b/modules/demux/mpeg/ts_descriptions.h
new file mode 100644
index 0000000000..3d514e625d
--- /dev/null
+++ b/modules/demux/mpeg/ts_descriptions.h
@@ -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
diff --git a/modules/demux/mpeg/ts_psi.c b/modules/demux/mpeg/ts_psi.c
index 74325e3022..4da3a488c1 100644
--- a/modules/demux/mpeg/ts_psi.c
+++ b/modules/demux/mpeg/ts_psi.c
@@ -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,
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0e69ba8ec4..e2c4251735 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -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



More information about the vlc-commits mailing list