Commit 88762648 authored by bcoudurier's avatar bcoudurier

parse pasp atom and set sample aspect ratio,

warn if transformation matrix differs from pasp,
based on a patch by Skal.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16066 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 6513cce3
...@@ -430,6 +430,22 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom) ...@@ -430,6 +430,22 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
return 0; return 0;
} }
static int mov_read_pasp(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
const int num = get_be32(pb);
const int den = get_be32(pb);
AVStream * const st = c->fc->streams[c->fc->nb_streams-1];
if (den != 0) {
if ((st->sample_aspect_ratio.den && den != st->sample_aspect_ratio.den) ||
(st->sample_aspect_ratio.num && num != st->sample_aspect_ratio.num))
av_log(c->fc, AV_LOG_WARNING,
"sample aspect ratio already set, overriding by 'pasp' atom\n");
st->sample_aspect_ratio.num = num;
st->sample_aspect_ratio.den = den;
}
return 0;
}
/* this atom contains actual media data */ /* this atom contains actual media data */
static int mov_read_mdat(MOVContext *c, ByteIOContext *pb, MOVAtom atom) static int mov_read_mdat(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{ {
...@@ -1754,6 +1770,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = { ...@@ -1754,6 +1770,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
{ MKTAG('S','M','I',' '), mov_read_smi }, /* Sorenson extension ??? */ { MKTAG('S','M','I',' '), mov_read_smi }, /* Sorenson extension ??? */
{ MKTAG('a','l','a','c'), mov_read_extradata }, /* alac specific atom */ { MKTAG('a','l','a','c'), mov_read_extradata }, /* alac specific atom */
{ MKTAG('a','v','c','C'), mov_read_glbl }, { MKTAG('a','v','c','C'), mov_read_glbl },
{ MKTAG('p','a','s','p'), mov_read_pasp },
{ MKTAG('s','t','b','l'), mov_read_default }, { MKTAG('s','t','b','l'), mov_read_default },
{ MKTAG('s','t','c','o'), mov_read_stco }, { MKTAG('s','t','c','o'), mov_read_stco },
{ MKTAG('s','t','s','c'), mov_read_stsc }, { MKTAG('s','t','s','c'), mov_read_stsc },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment