[vlc-commits] demux: mp4: don't use samplesize for audio v1/v2

Francois Cartegnie git at videolan.org
Fri Feb 8 13:57:17 CET 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Feb  8 11:13:11 2019 +0100| [94841e9477d2acd9382bfbb9414ff6e32d24587c] | committer: Francois Cartegnie

demux: mp4: don't use samplesize for audio v1/v2

refs #21814

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

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

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index b633d87b64..5a76e381b0 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -852,9 +852,12 @@ int SetupAudioES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
 
     p_track->fmt.audio.i_channels = p_soun->i_channelcount;
     p_track->fmt.audio.i_rate = p_soun->i_sampleratehi;
-    p_track->fmt.i_bitrate = p_soun->i_channelcount * p_soun->i_sampleratehi *
-                             p_soun->i_samplesize;
-    p_track->fmt.audio.i_bitspersample = p_soun->i_samplesize;
+    if( p_soun->i_qt_version == 0 ) /* otherwise defaults to meaningless 16 */
+    {
+        p_track->fmt.audio.i_bitspersample = p_soun->i_samplesize;
+        p_track->fmt.i_bitrate = p_soun->i_channelcount * p_soun->i_sampleratehi *
+                                 p_soun->i_samplesize;
+    }
 
     p_track->fmt.i_original_fourcc = p_sample->i_type;
 



More information about the vlc-commits mailing list