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

Francois Cartegnie git at videolan.org
Sun Apr 12 11:24:30 CEST 2015


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Apr 12 00:04:47 2015 +0200| [5a1cf7dbc8dc24f922566aa9de660dc997105f39] | committer: Jean-Baptiste Kempf

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

refs issues/no-sound-tv.mov

(cherry picked from commit 6e5228fdf9bedb1758577fba555a7e52321e48b5)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=5a1cf7dbc8dc24f922566aa9de660dc997105f39
---

 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 7edab94..7a52103 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3494,6 +3494,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;
             if ( *pi_nb_samples == QT_V0_MAX_SAMPLES )



More information about the vlc-commits mailing list