diff --git a/pr_generic.cpp b/pr_generic.cpp index 2c06c7aec..2bcf68356 100644 --- a/pr_generic.cpp +++ b/pr_generic.cpp @@ -299,19 +299,25 @@ void generic_packetizer_c::set_headers() { *(static_cast (&GetChild(video))) = hvideo_pixel_height; if ((ti->aspect_ratio != 1.0) && - ((hvideo_pixel_width / hvideo_pixel_height) != ti->aspect_ratio)) - *(static_cast - (&GetChild(video))) = hvideo_pixel_height; + ((hvideo_pixel_width / hvideo_pixel_height) != ti->aspect_ratio)) { + KaxVideoDisplayHeight &dheight = + GetChild(video); + *(static_cast(&dheight)) = hvideo_pixel_height; + dheight.SetDefaultSize(4); + } } if (hvideo_pixel_width != -1) { *(static_cast (&GetChild(video))) = hvideo_pixel_width; if ((ti->aspect_ratio != 1.0) && - ((hvideo_pixel_width / hvideo_pixel_height) != ti->aspect_ratio)) - *(static_cast - (&GetChild(video))) = + ((hvideo_pixel_width / hvideo_pixel_height) != ti->aspect_ratio)) { + KaxVideoDisplayWidth &dwidth = + GetChild(video); + *(static_cast(&dwidth)) = (uint64_t)(hvideo_pixel_height * ti->aspect_ratio); + dwidth.SetDefaultSize(4); + } } } else if (htrack_type == track_audio) {