[vlc-commits] demux: mp4: set bitmap mask when possible

Francois Cartegnie git at videolan.org
Wed Dec 19 15:14:20 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Dec 18 16:43:24 2018 +0100| [3d24a401e710186220dac597074dfc2ae81ec334] | committer: Francois Cartegnie

demux: mp4: set bitmap mask when possible

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

 modules/demux/mp4/essetup.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index 07d9407f74..d21e1b5a9c 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -1195,13 +1195,22 @@ int SetupAudioES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
             msg_Warn( p_demux, "discarding chan mapping" );
         }
 
-        if( aout_BitsPerSample( p_track->fmt.i_codec ) && i_vlc_mapping > 0 &&
-            aout_CheckChannelReorder( p_rg_chans_order, NULL, i_vlc_mapping,
-                                      p_track->rgi_chans_reordering ) )
+        if( i_vlc_mapping )
         {
-            p_track->b_chans_reorder = true;
-            p_track->fmt.audio.i_channels = i_channels;
-            p_track->fmt.audio.i_physical_channels = i_vlc_mapping;
+            const unsigned i_bps = aout_BitsPerSample( p_track->fmt.i_codec );
+            /* Uncompressed audio */
+            if( i_bps && aout_CheckChannelReorder( p_rg_chans_order, NULL,
+                                                   i_vlc_mapping,
+                                                   p_track->rgi_chans_reordering ) )
+                p_track->b_chans_reorder = true;
+
+            /* we can only set bitmap for VLC mapping or [re]mapped pcm audio
+             * as vlc can't enumerate channels for compressed content */
+            if( i_bps || p_track->rgi_chans_reordering == NULL )
+            {
+                p_track->fmt.audio.i_channels = i_channels;
+                p_track->fmt.audio.i_physical_channels = i_vlc_mapping;
+            }
         }
     }
 



More information about the vlc-commits mailing list