comparison mov.c @ 4080:8ddf05b864a4 libavformat

parse pasp atom and set sample aspect ratio, warn if transformation matrix differs from pasp, based on a patch by Skal.
author bcoudurier
date Thu, 11 Dec 2008 22:24:56 +0000
parents 82cbec030af5
children f693bc71dc1e
comparison
equal deleted inserted replaced
4079:82cbec030af5 4080:8ddf05b864a4
424 if (!(st->codec->codec_id = codec_get_id(mp4_audio_types, 424 if (!(st->codec->codec_id = codec_get_id(mp4_audio_types,
425 cfg.object_type))) 425 cfg.object_type)))
426 st->codec->codec_id = CODEC_ID_AAC; 426 st->codec->codec_id = CODEC_ID_AAC;
427 } 427 }
428 } 428 }
429 }
430 return 0;
431 }
432
433 static int mov_read_pasp(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
434 {
435 const int num = get_be32(pb);
436 const int den = get_be32(pb);
437 AVStream * const st = c->fc->streams[c->fc->nb_streams-1];
438 if (den != 0) {
439 if ((st->sample_aspect_ratio.den && den != st->sample_aspect_ratio.den) ||
440 (st->sample_aspect_ratio.num && num != st->sample_aspect_ratio.num))
441 av_log(c->fc, AV_LOG_WARNING,
442 "sample aspect ratio already set, overriding by 'pasp' atom\n");
443 st->sample_aspect_ratio.num = num;
444 st->sample_aspect_ratio.den = den;
429 } 445 }
430 return 0; 446 return 0;
431 } 447 }
432 448
433 /* this atom contains actual media data */ 449 /* this atom contains actual media data */
1752 { MKTAG('m','v','e','x'), mov_read_default }, 1768 { MKTAG('m','v','e','x'), mov_read_default },
1753 { MKTAG('m','v','h','d'), mov_read_mvhd }, 1769 { MKTAG('m','v','h','d'), mov_read_mvhd },
1754 { MKTAG('S','M','I',' '), mov_read_smi }, /* Sorenson extension ??? */ 1770 { MKTAG('S','M','I',' '), mov_read_smi }, /* Sorenson extension ??? */
1755 { MKTAG('a','l','a','c'), mov_read_extradata }, /* alac specific atom */ 1771 { MKTAG('a','l','a','c'), mov_read_extradata }, /* alac specific atom */
1756 { MKTAG('a','v','c','C'), mov_read_glbl }, 1772 { MKTAG('a','v','c','C'), mov_read_glbl },
1773 { MKTAG('p','a','s','p'), mov_read_pasp },
1757 { MKTAG('s','t','b','l'), mov_read_default }, 1774 { MKTAG('s','t','b','l'), mov_read_default },
1758 { MKTAG('s','t','c','o'), mov_read_stco }, 1775 { MKTAG('s','t','c','o'), mov_read_stco },
1759 { MKTAG('s','t','s','c'), mov_read_stsc }, 1776 { MKTAG('s','t','s','c'), mov_read_stsc },
1760 { MKTAG('s','t','s','d'), mov_read_stsd }, /* sample description */ 1777 { MKTAG('s','t','s','d'), mov_read_stsd }, /* sample description */
1761 { MKTAG('s','t','s','s'), mov_read_stss }, /* sync sample */ 1778 { MKTAG('s','t','s','s'), mov_read_stss }, /* sync sample */