[vlc-devel] [PATCH] Support for rotated MP4 Movies (bug #2882)

Matthias Keiser matthias at tristan-inc.com
Thu Feb 6 23:16:35 CET 2014


From 851750a9a4cec130cf4b91233ddf7f8d7b9d5771 Mon Sep 17 00:00:00 2001
From: Matthias Keiser <matthias at tristan-inc.com>
Date: Thu, 6 Feb 2014 16:00:19 +0100
Subject: [PATCH 03/13] MP4 demux: Check if the file actually contains
 fragments before setting the fragmented flag.

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

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index bbc071f..8284fa6 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -361,7 +361,7 @@ static int Open( vlc_object_t * p_this )
     if( LoadInitFrag( p_demux, b_smooth ) != VLC_SUCCESS )
         goto error;
 
-    if( MP4_BoxCount( p_sys->p_root, "/moov/mvex" ) > 0 )
+    if( MP4_BoxCount( p_sys->p_root, "/moov/mvex" ) > 0 && MP4_BoxCount( p_sys->p_root, "/moof" ) > 0)
     {
         p_sys->b_fragmented = true;
     }
@@ -378,6 +378,9 @@ static int Open( vlc_object_t * p_this )
         CreateTracksFromSmooBox( p_demux );
         return VLC_SUCCESS;
     }
+    //FIXME: relying on STREAM_CAN_FASTSEEK to decide if we can parse
+    // a file is a bad heuristic, because local files are always
+    // fast-seekable.
     else if( p_sys->b_fragmented && b_seekable )
     {
         /* We are not yet able to demux a fragmented MP4 file, using the 'mfra'
@@ -388,6 +391,7 @@ static int Open( vlc_object_t * p_this )
         stream_Seek( p_demux->s, 0 ); /* rewind, for other demux */
         goto error;
     }
+    //FIXME: This means that avformat will take over, but it doesn't do a better job than we if the file is not seekable.
     else if( !p_sys->b_fragmented && !b_seekable )
     {
         msg_Warn( p_demux, "MP4 plugin discarded (not fast-seekable)" );
-- 
1.8.3.4 (Apple Git-47)





More information about the vlc-devel mailing list