[vlc-commits] transcode: cleanup channel setup and allow upmixing

Ilkka Ollakka git at videolan.org
Fri Mar 14 13:51:21 CET 2014


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Tue Mar 11 13:35:45 2014 +0200| [6b7dcd7016c6cd46f4a685e5bdadb4e29c5f38d1] | committer: Ilkka Ollakka

transcode: cleanup channel setup and allow upmixing

Allow channel upmixing as we have channel mixer that is able to do it.

Fixes #7261

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

 modules/stream_out/transcode/audio.c |   24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index 8a66ab0..67ff948 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -233,14 +233,15 @@ int transcode_audio_process( sout_stream_t *p_stream,
                 id->p_decoder->fmt_out.audio.i_bitspersample;
             id->p_encoder->fmt_out.audio.i_channels = p_sys->i_channels > 0 ?
                 p_sys->i_channels : id->p_decoder->fmt_out.audio.i_channels;
-            /* Sanity check for audio channels */
-            id->p_encoder->fmt_out.audio.i_channels =
-                __MIN( id->p_encoder->fmt_out.audio.i_channels,
-                       id->p_decoder->fmt_out.audio.i_channels );
+
+            id->p_encoder->fmt_in.audio.i_original_channels =
             id->p_encoder->fmt_out.audio.i_original_channels =
-                id->p_decoder->fmt_in.audio.i_physical_channels;
+                id->p_decoder->fmt_out.audio.i_physical_channels;
+
+            id->p_encoder->fmt_in.audio.i_physical_channels =
             id->p_encoder->fmt_out.audio.i_physical_channels =
                 pi_channels_maps[id->p_encoder->fmt_out.audio.i_channels];
+
             if( transcode_audio_initialize_encoder( id, p_stream ) )
             {
                 msg_Err( p_stream, "cannot create audio chain" );
@@ -334,12 +335,12 @@ bool transcode_audio_add( sout_stream_t *p_stream, es_format_t *p_fmt,
         p_fmt->audio.i_bitspersample;
     id->p_encoder->fmt_out.audio.i_channels = p_sys->i_channels > 0 ?
         p_sys->i_channels : p_fmt->audio.i_channels;
-    /* Sanity check for audio channels */
-    id->p_encoder->fmt_out.audio.i_channels =
-        __MIN( id->p_encoder->fmt_out.audio.i_channels,
-               id->p_decoder->fmt_in.audio.i_channels );
+
+    id->p_encoder->fmt_in.audio.i_original_channels =
     id->p_encoder->fmt_out.audio.i_original_channels =
-        id->p_decoder->fmt_in.audio.i_physical_channels;
+        id->p_decoder->fmt_out.audio.i_physical_channels;
+
+    id->p_encoder->fmt_in.audio.i_physical_channels =
     id->p_encoder->fmt_out.audio.i_physical_channels =
             pi_channels_maps[id->p_encoder->fmt_out.audio.i_channels];
 
@@ -376,8 +377,5 @@ bool transcode_audio_add( sout_stream_t *p_stream, es_format_t *p_fmt,
             aout_FiltersDelete( (vlc_object_t *)NULL, id->p_af_chain );
         id->p_af_chain = NULL;
     }
-
-    date_Init( &id->interpolated_pts, p_fmt->audio.i_rate, 1 );
-
     return true;
 }



More information about the vlc-commits mailing list