diff --git a/ChangeLog b/ChangeLog index a898a87ba..e0bfd6914 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2003-08-11 Moritz Bunkus + * Released v0.6.2. + + * mkvmerge: Video aspect ratio was set wrong if the user did not + specify any. + * Released v0.6.1. * mkvmerge: RealVideo: Support for all kinds of frames including diff --git a/src/mkvmerge.cpp b/src/mkvmerge.cpp index 3d087cec9..d99d7802a 100644 --- a/src/mkvmerge.cpp +++ b/src/mkvmerge.cpp @@ -1039,7 +1039,7 @@ static void identify(const char *filename) { ti.languages = new vector; ti.sub_charsets = new vector; ti.all_tags = new vector; - ti.aspect_ratio = 1.0; + ti.aspect_ratio = 0.0; ti.atracks = new vector; ti.vtracks = new vector; ti.stracks = new vector; @@ -1096,7 +1096,7 @@ static void parse_args(int argc, char **argv) { ti.languages = new vector; ti.sub_charsets = new vector; ti.all_tags = new vector; - ti.aspect_ratio = 1.0; + ti.aspect_ratio = 0.0; ti.atracks = new vector; ti.vtracks = new vector; ti.stracks = new vector; diff --git a/src/pr_generic.cpp b/src/pr_generic.cpp index ed10b58f5..00a9d2500 100644 --- a/src/pr_generic.cpp +++ b/src/pr_generic.cpp @@ -409,6 +409,9 @@ void generic_packetizer_c::set_headers() { GetChild(*track_entry); if ((hvideo_pixel_height != -1) && (hvideo_pixel_width != -1)) { + if (ti->aspect_ratio == 0.0) + ti->aspect_ratio = (float)hvideo_pixel_width / + (float)hvideo_pixel_height; if (ti->aspect_ratio > ((float)hvideo_pixel_width / (float)hvideo_pixel_height)) { disp_width = (int)(hvideo_pixel_height * ti->aspect_ratio); @@ -416,7 +419,7 @@ void generic_packetizer_c::set_headers() { } else { disp_width = hvideo_pixel_width; - disp_height = (int)(hvideo_pixel_width * ti->aspect_ratio); + disp_height = (int)(hvideo_pixel_width / ti->aspect_ratio); } diff --git a/src/r_matroska.cpp b/src/r_matroska.cpp index 53b08c66e..c68f71b16 100644 --- a/src/r_matroska.cpp +++ b/src/r_matroska.cpp @@ -1113,7 +1113,7 @@ void kax_reader_c::create_packetizers() { t->v_width, t->v_height, t->v_bframes, &nti); - if (nti.aspect_ratio == 1.0) { // The user didn't set it. + if (nti.aspect_ratio == 0.0) { // The user didn't set it. if (t->v_dwidth == 0) t->v_dwidth = t->v_width; if (t->v_dheight == 0)