Force a default size of 4 for the display width/height so that future changes of the AR will not have to rewrite the complete file.

This commit is contained in:
Moritz Bunkus 2003-06-15 08:51:52 +00:00
parent d9329f351a
commit ecbe3f456e

View File

@ -299,19 +299,25 @@ void generic_packetizer_c::set_headers() {
*(static_cast<EbmlUInteger *>
(&GetChild<KaxVideoPixelHeight>(video))) = hvideo_pixel_height;
if ((ti->aspect_ratio != 1.0) &&
((hvideo_pixel_width / hvideo_pixel_height) != ti->aspect_ratio))
*(static_cast<EbmlUInteger *>
(&GetChild<KaxVideoDisplayHeight>(video))) = hvideo_pixel_height;
((hvideo_pixel_width / hvideo_pixel_height) != ti->aspect_ratio)) {
KaxVideoDisplayHeight &dheight =
GetChild<KaxVideoDisplayHeight>(video);
*(static_cast<EbmlUInteger *>(&dheight)) = hvideo_pixel_height;
dheight.SetDefaultSize(4);
}
}
if (hvideo_pixel_width != -1) {
*(static_cast<EbmlUInteger *>
(&GetChild<KaxVideoPixelWidth>(video))) = hvideo_pixel_width;
if ((ti->aspect_ratio != 1.0) &&
((hvideo_pixel_width / hvideo_pixel_height) != ti->aspect_ratio))
*(static_cast<EbmlUInteger *>
(&GetChild<KaxVideoDisplayWidth>(video))) =
((hvideo_pixel_width / hvideo_pixel_height) != ti->aspect_ratio)) {
KaxVideoDisplayWidth &dwidth =
GetChild<KaxVideoDisplayWidth>(video);
*(static_cast<EbmlUInteger *>(&dwidth)) =
(uint64_t)(hvideo_pixel_height * ti->aspect_ratio);
dwidth.SetDefaultSize(4);
}
}
} else if (htrack_type == track_audio) {