[vlc-commits] demux: mp4: workaround for broken stsz (twos sample)

Francois Cartegnie git at videolan.org
Sun Apr 12 00:06:23 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Apr 12 00:04:47 2015 +0200| [6e5228fdf9bedb1758577fba555a7e52321e48b5] | committer: Francois Cartegnie

demux: mp4: workaround for broken stsz (twos sample)

refs issues/no-sound-tv.mov

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

 modules/demux/mp4/mp4.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index a86419a..55117b0 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3097,6 +3097,9 @@ static uint32_t MP4_TrackGetReadSize( mp4_track_t *p_track, uint32_t *pi_nb_samp
             (*pi_nb_samples)++;
             if ( p_track->i_sample_size == 0 )
                 i_size += p_track->p_sample_size[i];
+            /* broken stsz sample size == 1 */
+            else if ( p_track->i_sample_size == 1 && p_soun->i_samplesize > p_track->i_sample_size * 8 )
+                i_size += p_soun->i_samplesize * p_soun->i_channelcount / 8;
             else
                 i_size += p_track->i_sample_size;
 



More information about the vlc-commits mailing list