[vlc-commits] demux: mp4: export new channels mapping when reordering

Francois Cartegnie git at videolan.org
Tue Jul 26 20:26:42 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jul 26 20:22:48 2016 +0200| [957d86876a5070f10e8ed930a7e9629e65ad4094] | committer: Francois Cartegnie

demux: mp4: export new channels mapping when reordering

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

 modules/demux/mp4/essetup.c | 14 ++++++++++----
 modules/demux/mp4/mp4.c     |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index ab44945..a54ea1f 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -969,11 +969,17 @@ int SetupAudioES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
                 }
             }
             rgi_chans_sequence[i_channels] = 0;
-            p_track->b_chans_reorder = !!
-                    aout_CheckChannelReorder( rgi_chans_sequence, NULL, i_vlc_mapping,
-                                              p_track->rgi_chans_reordering );
-        }
+            if( aout_CheckChannelReorder( rgi_chans_sequence, NULL, i_vlc_mapping,
+                                          p_track->rgi_chans_reordering ) &&
+                aout_BitsPerSample( p_track->fmt.i_codec ) )
+            {
+                p_track->b_chans_reorder = true;
+                p_track->fmt.audio.i_channels = i_channels;
+                p_track->fmt.audio.i_physical_channels =
+                p_track->fmt.audio.i_original_channels = i_vlc_mapping;
+            }
 
+        }
     }
 
     SetupGlobalExtensions( p_track, p_sample );
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index f9621d1..0295962 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -434,7 +434,7 @@ static block_t * MP4_Block_Read( demux_t *p_demux, const mp4_track_t *p_track, i
 
 static void MP4_Block_Send( demux_t *p_demux, mp4_track_t *p_track, block_t *p_block )
 {
-    if ( p_track->b_chans_reorder && aout_BitsPerSample( p_track->fmt.i_codec ) )
+    if ( p_track->b_chans_reorder )
     {
         aout_ChannelReorder( p_block->p_buffer, p_block->i_buffer,
                              p_track->fmt.audio.i_channels,



More information about the vlc-commits mailing list