summaryrefslogtreecommitdiff
path: root/libavformat/dfa.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-15 12:07:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-15 12:13:41 +0200
commit1557f34b10e6095a5cbf13ac5fcd3c095e2a93af (patch)
treee93ee2f5e5f73334c4daab0380ab200bbdbd1773 /libavformat/dfa.c
parent1cb02d4fbc290c6e485fd301b902d8258d5c4994 (diff)
downloadffmpeg-1557f34b10e6095a5cbf13ac5fcd3c095e2a93af.tar.gz
dfa: support decoding version=1.0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/dfa.c')
-rw-r--r--libavformat/dfa.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/dfa.c b/libavformat/dfa.c
index 8cf2f24fc8..5799d983cf 100644
--- a/libavformat/dfa.c
+++ b/libavformat/dfa.c
@@ -36,13 +36,15 @@ static int dfa_read_header(AVFormatContext *s)
AVIOContext *pb = s->pb;
AVStream *st;
int frames;
+ int version;
uint32_t mspf;
if (avio_rl32(pb) != MKTAG('D', 'F', 'I', 'A')) {
av_log(s, AV_LOG_ERROR, "Invalid magic for DFA\n");
return AVERROR_INVALIDDATA;
}
- avio_skip(pb, 2); // unused
+
+ version = avio_rl16(pb);
frames = avio_rl16(pb);
st = avformat_new_stream(s, NULL);
@@ -62,6 +64,12 @@ static int dfa_read_header(AVFormatContext *s)
avio_skip(pb, 128 - 16); // padding
st->duration = frames;
+ st->codec->extradata = av_malloc(2);
+ st->codec->extradata_size = 2;
+ AV_WL16(st->codec->extradata, version);
+ if (version == 0x100)
+ st->sample_aspect_ratio = (AVRational){2, 1};
+
return 0;
}