changeset 3551:a4fb7b8098c3 libavformat

Electronic Arts CMV demuxer
author pross
date Tue, 08 Jul 2008 13:24:13 +0000
parents db0c31111238
children 8bce09af18e6
files electronicarts.c
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/electronicarts.c	Tue Jul 08 12:44:08 2008 +0000
+++ b/electronicarts.c	Tue Jul 08 13:24:13 2008 +0000
@@ -1,5 +1,6 @@
 /* Electronic Arts Multimedia File Demuxer
  * Copyright (c) 2004  The ffmpeg Project
+ * Copyright (c) 2006-2008 Peter Ross
  *
  * This file is part of FFmpeg.
  *
@@ -45,6 +46,7 @@
 #define MV0K_TAG MKTAG('M', 'V', '0', 'K')
 #define MV0F_TAG MKTAG('M', 'V', '0', 'F')
 #define MVIh_TAG MKTAG('M', 'V', 'I', 'h')    /* CMV header */
+#define MVIf_TAG MKTAG('M', 'V', 'I', 'f')    /* CMV i-frame */
 
 typedef struct EaDemuxContext {
     int big_endian;
@@ -299,6 +301,11 @@
                 err = process_audio_header_sead(s);
                 break;
 
+            case MVIh_TAG :
+                ea->video_codec = CODEC_ID_CMV;
+                ea->time_base = (AVRational){0,0};
+                break;
+
             case MVhd_TAG :
                 err = process_video_header_vp6(s);
                 break;
@@ -441,9 +448,17 @@
             packet_read = 1;
             break;
 
+        case MVIh_TAG:
+            key = PKT_FLAG_KEY;
+        case MVIf_TAG:
+            url_fseek(pb, -8, SEEK_CUR);     // include chunk preamble
+            chunk_size += 8;
+            goto get_video_packet;
+
         case MV0K_TAG:
             key = PKT_FLAG_KEY;
         case MV0F_TAG:
+get_video_packet:
             ret = av_get_packet(pb, pkt, chunk_size);
             if (ret != chunk_size)
                 ret = AVERROR_IO;