[vlc-devel] [PATCH] Added alang option to transcode (update)

Mat King mking at trilithic.com
Fri Oct 23 19:52:12 CEST 2009


>From ccd58d1a26a4b708c7ecfdb5125ac6d2b8d86436 Mon Sep 17 00:00:00 2001
From: Mathew King <mking at trilithic.com>
Date: Fri, 23 Oct 2009 13:45:17 -0400
Subject: [PATCH] Added alang option to transcode (update)

When using the transcode output filter there is now the option of
setting the language of the audio stream.
---
 modules/stream_out/transcode.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/transcode.c
b/modules/stream_out/transcode.c
index dcccea1..a632f12 100644
--- a/modules/stream_out/transcode.c
+++ b/modules/stream_out/transcode.c
@@ -104,6 +104,9 @@
 #define ARATE_TEXT N_("Audio sample rate")
 #define ARATE_LONGTEXT N_( \
  "Sample rate of the transcoded audio stream (11250, 22500, 44100 or
48000).")
+#define ALANG_TEXT N_("Audio Language")
+#define ALANG_LONGTEXT N_( \
+    "This is the language of the audio stream.")
 #define ACHANS_TEXT N_("Audio channels")
 #define ACHANS_LONGTEXT N_( \
     "Number of audio channels in the transcoded streams." )
@@ -204,6 +207,8 @@ vlc_module_begin ()
                 ACODEC_LONGTEXT, false )
     add_integer( SOUT_CFG_PREFIX "ab", 0, NULL, AB_TEXT,
                  AB_LONGTEXT, false )
+    add_string( SOUT_CFG_PREFIX "alang", NULL, NULL, ALANG_TEXT,
+                ALANG_LONGTEXT, true )
     add_integer( SOUT_CFG_PREFIX "channels", 0, NULL, ACHANS_TEXT,
                  ACHANS_LONGTEXT, false )
     add_integer( SOUT_CFG_PREFIX "samplerate", 0, NULL, ARATE_TEXT,
@@ -240,7 +245,7 @@ vlc_module_end ()
 static const char *const ppsz_sout_options[] = {
     "venc", "vcodec", "vb",
     "scale", "fps", "width", "height", "vfilter", "deinterlace",
-    "deinterlace-module", "threads", "hurry-up", "aenc", "acodec",
"ab",
+    "deinterlace-module", "threads", "hurry-up", "aenc", "acodec",
"ab", "alang",
     "afilter", "samplerate", "channels", "senc", "scodec", "soverlay",
     "sfilter", "osd", "audio-sync", "high-priority", "maxwidth",
"maxheight",
     NULL
@@ -317,6 +322,7 @@ struct sout_stream_sys_t
     /* Audio */
     vlc_fourcc_t    i_acodec;   /* codec audio (0 if not transcode) */
     char            *psz_aenc;
+    char            *psz_alang;
     config_chain_t  *p_audio_cfg;
     uint32_t        i_sample_rate;
     uint32_t        i_channels;
@@ -412,6 +418,8 @@ static int Open( vlc_object_t *p_this )
     }
     free( val.psz_string );
 
+    p_sys->psz_alang = var_GetNonEmptyString( p_stream, SOUT_CFG_PREFIX
"alang" );
+
     var_Get( p_stream, SOUT_CFG_PREFIX "ab", &val );
     p_sys->i_abitrate = val.i_int;
     if( p_sys->i_abitrate < 4000 ) p_sys->i_abitrate *= 1000;
@@ -637,6 +645,7 @@ static void Close( vlc_object_t * p_this )
 
     config_ChainDestroy( p_sys->p_audio_cfg );
     free( p_sys->psz_aenc );
+    free( p_sys->psz_alang );
 
     free( p_sys->psz_vf2 );
 
@@ -712,7 +721,10 @@ static sout_stream_id_t *Add( sout_stream_t
*p_stream, es_format_t *p_fmt )
     es_format_Init( &id->p_encoder->fmt_out, p_fmt->i_cat, 0 );
     id->p_encoder->fmt_out.i_id    = p_fmt->i_id;
     id->p_encoder->fmt_out.i_group = p_fmt->i_group;
-    if( p_fmt->psz_language )
+
+    if( p_sys->psz_alang )
+        id->p_encoder->fmt_out.psz_language = strdup( p_sys->psz_alang
);
+    else if( p_fmt->psz_language )
         id->p_encoder->fmt_out.psz_language = strdup(
p_fmt->psz_language );
 
     if( p_fmt->i_cat == AUDIO_ES && (p_sys->i_acodec ||
p_sys->psz_aenc) )
-- 
1.6.0.4


Notice: This e-mail is intended solely for use of the individual or entity to which it is addressed and may contain information that is proprietary, privileged, company confidential and/or exempt from disclosure under applicable law. If the reader is not the intended recipient or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. Information contained in, or documents attached to, this email may contain technology subject to U.S. export control laws.  Recipient is solely responsible for ensuring that any export, re-export, transfer or disclosure of this information outside of the United States, or to foreign nationals within the United States, is in accordance with applicable export control laws.  If you have received this communication in error, please notify the sender by reply e-mail or collect telephone call and delete or destroy all copies of this e-mail message, any physical copies made of this e-mail message and/or any file attachment(s).




More information about the vlc-devel mailing list