[FFmpeg-cvslog] Improve MPEG-PS-in-MOV detection.

Carl Eugen Hoyos git at videolan.org
Sun Oct 21 19:31:33 CEST 2012


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Oct 21 19:30:43 2012 +0200| [fa190b3cd736ae10e3af7d893423eb121b70b803] | committer: Carl Eugen Hoyos

Improve MPEG-PS-in-MOV detection.

Fixes issue 1520.

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

 libavformat/mov.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index fb62bfb..ce4865d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2908,15 +2908,14 @@ static int mov_probe(AVProbeData *p)
          * MOV-packed MPEG-PS */
         offset = moov_offset;
 
-        while(offset < (p->buf_size - 20)){ /* Sufficient space */
-               /* We found an actual stsd atom */
-            if(AV_RL32(p->buf+offset)       == MKTAG('s','t','s','d') &&
-               /* Make sure there's only one stream */
-               AV_RB32(p->buf + offset + 8)  == 1 &&
-               AV_RL32(p->buf + offset + 16) == MKTAG('m','1','s',' ')
-            ){
-                av_log(NULL, AV_LOG_WARNING, "Found m1s tag indicating this is a MOV-packed MPEG-PS.\n");
-                /* We found an stsd atom describing an MPEG-PS-in-MOV, return a
+        while(offset < (p->buf_size - 16)){ /* Sufficient space */
+               /* We found an actual hdlr atom */
+            if(AV_RL32(p->buf + offset     ) == MKTAG('h','d','l','r') &&
+               AV_RL32(p->buf + offset +  8) == MKTAG('m','h','l','r') &&
+               AV_RL32(p->buf + offset + 12) == MKTAG('M','P','E','G')){
+                av_log(NULL, AV_LOG_WARNING, "Found media data tag MPEG indicating this is a MOV-packed MPEG-PS.\n");
+                /* We found a media handler reference atom describing an
+                 * MPEG-PS-in-MOV, return a
                  * low score to force expanding the probe window until
                  * mpegps_probe finds what it needs */
                 return 5;



More information about the ffmpeg-cvslog mailing list