diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavformat/dfa.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavformat/dfa.c')
| -rw-r--r-- | ffmpeg/libavformat/dfa.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ffmpeg/libavformat/dfa.c b/ffmpeg/libavformat/dfa.c index 8cf2f24..9cd13e2 100644 --- a/ffmpeg/libavformat/dfa.c +++ b/ffmpeg/libavformat/dfa.c @@ -28,6 +28,9 @@ static int dfa_probe(AVProbeData *p) if (p->buf_size < 4 || AV_RL32(p->buf) != MKTAG('D', 'F', 'I', 'A')) return 0; + if (AV_RL32(p->buf + 16) != 0x80) + return AVPROBE_SCORE_MAX / 4; + return AVPROBE_SCORE_MAX; } @@ -36,13 +39,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 +67,12 @@ static int dfa_read_header(AVFormatContext *s) avio_skip(pb, 128 - 16); // padding st->duration = frames; + if (ff_alloc_extradata(st->codec, 2)) + return AVERROR(ENOMEM); + AV_WL16(st->codec->extradata, version); + if (version == 0x100) + st->sample_aspect_ratio = (AVRational){2, 1}; + return 0; } |
