aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/electronicarts.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2008-07-08 13:24:13 +0000
committerPeter Ross <pross@xvid.org>2008-07-08 13:24:13 +0000
commitb2f181c27083d2b22c4e0e37b9888c781fb22349 (patch)
tree330bcc4db529282a43173184c4e05d7192647b56 /libavformat/electronicarts.c
parent495900f78b4a86cd064358fcac576a75045a62f7 (diff)
downloadffmpeg-b2f181c27083d2b22c4e0e37b9888c781fb22349.tar.gz
Electronic Arts CMV demuxer
Originally committed as revision 14111 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/electronicarts.c')
-rw-r--r--libavformat/electronicarts.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 0b1f017b6e..7a7207b45c 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -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 @@ static int process_ea_header(AVFormatContext *s) {
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 @@ static int ea_read_packet(AVFormatContext *s,
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;