[vlc-commits] demux: mp4: compute new pos for audio if blockalign is missing

Francois Cartegnie git at videolan.org
Sun Nov 16 19:58:14 CET 2014


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Nov 16 13:03:01 2014 +0100| [88f419901d1c1f193e9138db9de712128fc4aaf3] | committer: Jean-Baptiste Kempf

demux: mp4: compute new pos for audio if blockalign is missing

Prevented playback of blockalign less audio samples

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

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

 modules/demux/mp4/mp4.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 51024ef..8b9bf6c 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3509,7 +3509,8 @@ static uint64_t MP4_TrackGetPos( mp4_track_t *p_track )
         MP4_Box_data_sample_soun_t *p_soun =
             p_track->p_sample->data.p_sample_soun;
 
-        if( p_track->fmt.i_cat != AUDIO_ES || p_soun->i_qt_version == 0 )
+        if( p_track->fmt.i_cat != AUDIO_ES || p_soun->i_qt_version == 0 ||
+            p_track->fmt.audio.i_blockalign <= 1 )
         {
             i_pos += ( p_track->i_sample -
                        p_track->chunk[p_track->i_chunk].i_sample_first ) *
@@ -3518,9 +3519,8 @@ static uint64_t MP4_TrackGetPos( mp4_track_t *p_track )
         else
         {
             /* we read chunk by chunk unless a blockalign is requested */
-            if( p_track->fmt.audio.i_blockalign > 1 )
-                i_pos += ( p_track->i_sample - p_track->chunk[p_track->i_chunk].i_sample_first ) /
-                                p_soun->i_sample_per_packet * p_soun->i_bytes_per_frame;
+            i_pos += ( p_track->i_sample - p_track->chunk[p_track->i_chunk].i_sample_first ) /
+                        p_soun->i_sample_per_packet * p_soun->i_bytes_per_frame;
         }
     }
     else



More information about the vlc-commits mailing list