comparison mxfenc.c @ 4277:a5e558f1a64f libavformat

stored height is a multiple of 16 for mpeg2
author bcoudurier
date Fri, 23 Jan 2009 20:15:46 +0000
parents 2040c6c46c3c
children 5bf611a311b9
comparison
equal deleted inserted replaced
4276:d9c25a41b461 4277:a5e558f1a64f
555 static const UID mxf_wav_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 }; 555 static const UID mxf_wav_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,0x01,0x01,0x0d,0x01,0x01,0x01,0x01,0x01,0x48,0x00 };
556 556
557 static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st) 557 static void mxf_write_mpegvideo_desc(AVFormatContext *s, AVStream *st)
558 { 558 {
559 ByteIOContext *pb = s->pb; 559 ByteIOContext *pb = s->pb;
560 int stored_height = (st->codec->height+15)/16*16;
560 561
561 mxf_write_generic_desc(pb, st, mxf_mpegvideo_descriptor_key); 562 mxf_write_generic_desc(pb, st, mxf_mpegvideo_descriptor_key);
562 563
563 mxf_write_local_tag(pb, 4, 0x3203); 564 mxf_write_local_tag(pb, 4, 0x3203);
564 put_be32(pb, st->codec->width); 565 put_be32(pb, st->codec->width);
565 566
566 mxf_write_local_tag(pb, 4, 0x3202); 567 mxf_write_local_tag(pb, 4, 0x3202);
567 put_be32(pb, st->codec->height); 568 put_be32(pb, stored_height);
568 569
569 mxf_write_local_tag(pb, 8, 0x320E); 570 mxf_write_local_tag(pb, 8, 0x320E);
570 put_be32(pb, st->codec->height * st->sample_aspect_ratio.den); 571 put_be32(pb, st->codec->height * st->sample_aspect_ratio.den);
571 put_be32(pb, st->codec->width * st->sample_aspect_ratio.num); 572 put_be32(pb, st->codec->width * st->sample_aspect_ratio.num);
572 } 573 }