aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2003-09-08 04:17:40 +0000
committerMike Melanson <mike@multimedia.cx>2003-09-08 04:17:40 +0000
commit9e8cd0db54dc5290bc6f4e22526355bff2666f80 (patch)
tree9c511ea59678dafc9a3a0b535a629baaf10f103f
parent048446bfeba294c19e03607de67d8aa64f550f83 (diff)
downloadffmpeg-9e8cd0db54dc5290bc6f4e22526355bff2666f80.tar.gz
hacks to support Xan AVI files
Originally committed as revision 2220 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/avidec.c7
-rw-r--r--libavformat/avienc.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 050769b870..648d42370f 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -88,6 +88,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
unsigned int size, nb_frames;
int i, n;
AVStream *st;
+ int xan_video = 0; /* hack to support Xan A/V */
if (get_riff(avi, pb) < 0)
return -1;
@@ -274,12 +275,18 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec.codec_type = CODEC_TYPE_VIDEO;
st->codec.codec_tag = tag1;
st->codec.codec_id = codec_get_id(codec_bmp_tags, tag1);
+ if (st->codec.codec_id == CODEC_ID_XAN_WC4)
+ xan_video = 1;
// url_fskip(pb, size - 5 * 4);
break;
case CODEC_TYPE_AUDIO:
get_wav_header(pb, &st->codec, size);
if (size%2) /* 2-aligned (fix for Stargate SG-1 - 3x18 - Shades of Grey.avi) */
url_fskip(pb, 1);
+ /* special case time: To support Xan DPCM, hardcode
+ * the format if Xxan is the video codec */
+ if (xan_video)
+ st->codec.codec_id = CODEC_ID_XAN_DPCM;
break;
default:
url_fskip(pb, size);
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 4d60e04740..103860b277 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -143,6 +143,7 @@ const CodecTag codec_bmp_tags[] = {
{ CODEC_ID_ASV2, MKTAG('A', 'S', 'V', '2') },
{ CODEC_ID_VCR1, MKTAG('V', 'C', 'R', '1') },
{ CODEC_ID_FFV1, MKTAG('F', 'F', 'V', '1') },
+ { CODEC_ID_XAN_WC4, MKTAG('X', 'x', 'a', 'n') },
{ 0, 0 },
};