[vlc-commits] demux: mp4: handle Qt v1 redefined samples tables (fix #12773)

Francois Cartegnie git at videolan.org
Sun Nov 16 13:12:07 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Nov 15 18:26:44 2014 +0100| [d54bd1fc39a4720d7e0d955fd34214cf01d938bf] | committer: Francois Cartegnie

demux: mp4: handle Qt v1 redefined samples tables (fix #12773)

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

 modules/demux/mp4/essetup.c |   17 ++++++++++-------
 modules/demux/mp4/mp4.c     |   10 +++++++++-
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index 87292e6..78c6650 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -441,16 +441,19 @@ int SetupAudioES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
         default:
             break;
         }
-    }
 
-    if( p_track->i_sample_size != 0 && p_soun->i_qt_version == 1 &&
-        p_soun->i_sample_per_packet <= 0 )
-    {
-        msg_Err( p_demux, "Invalid sample per packet value for qt_version 1. Broken muxer!" );
-        p_soun->i_qt_version = 0;
+        if ( p_sample->data.p_sample_soun->i_compressionid == 0xFFFE /* -2 */)
+        {
+            /* redefined sample tables for vbr audio */
+        }
+        else if ( p_track->i_sample_size != 0 && p_soun->i_sample_per_packet == 0 )
+        {
+            msg_Err( p_demux, "Invalid sample per packet value for qt_version 1. Broken muxer! %u %u",
+                     p_track->i_sample_size, p_soun->i_sample_per_packet );
+            p_soun->i_qt_version = 0;
+        }
     }
 
-
     /* Endianness atom */
     const MP4_Box_t *p_enda = MP4_BoxGet( p_sample, "wave/enda" );
     if( !p_enda )
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index ae629dc..34bd180 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3020,7 +3020,15 @@ static uint32_t MP4_TrackGetReadSize( mp4_track_t *p_track, uint32_t *pi_nb_samp
 
         if( p_soun->i_qt_version == 1 )
         {
-            if ( p_soun->i_compressionid != 0 || p_soun->i_bytes_per_sample > 1 ) /* compressed */
+            if ( p_soun->i_compressionid == 0xFFFE )
+            {
+                *pi_nb_samples = 1; /* != number of audio samples */
+                if ( p_track->i_sample_size )
+                    return p_track->i_sample_size;
+                else
+                    return p_track->p_sample_size[p_track->i_sample];
+            }
+            else if ( p_soun->i_compressionid != 0 || p_soun->i_bytes_per_sample > 1 ) /* compressed */
             {
                 /* in this case we are dealing with compressed data
                    -2 in V1: additional fields are meaningless (VBR and such) */



More information about the vlc-commits mailing list