[vlc-commits] demux: mp4: fix compression in v0 samples

Francois Cartegnie git at videolan.org
Thu Jan 15 18:35:16 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jan 15 18:27:34 2015 +0100| [b7ed5a6690538e89f15137f7b4697d7252564a03] | committer: Francois Cartegnie

demux: mp4: fix compression in v0 samples

Since (*) we can't tell if the sample is v0 follows the ISO
spec or comes from qt and then means uncompressed,
we can't agregate samples reliably.

* our muxer removed qt brand from files.

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

 modules/demux/mp4/mp4.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 083ca0a..e221024 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3080,7 +3080,7 @@ static uint32_t MP4_TrackGetReadSize( mp4_track_t *p_track, uint32_t *pi_nb_samp
             }
         }
 
-        /* uncompressed v0 */
+        /* uncompressed v0 (qt) or... not (ISO) */
         *pi_nb_samples = 0;
         for( uint32_t i=p_track->i_sample;
              i<p_chunk->i_sample_first+p_chunk->i_sample_count &&
@@ -3092,6 +3092,14 @@ static uint32_t MP4_TrackGetReadSize( mp4_track_t *p_track, uint32_t *pi_nb_samp
                 i_size += p_track->p_sample_size[i];
             else
                 i_size += p_track->i_sample_size;
+
+            /* Try to detect compression in ISO */
+            if(p_soun->i_compressionid != 0)
+            {
+                /* Return only 1 sample */
+                break;
+            }
+
             if ( *pi_nb_samples == QT_V0_MAX_SAMPLES )
                 break;
         }



More information about the vlc-commits mailing list