diff --git a/src/mkvmerge.cpp b/src/mkvmerge.cpp index e743e760d..7acd14934 100644 --- a/src/mkvmerge.cpp +++ b/src/mkvmerge.cpp @@ -1415,6 +1415,7 @@ static void parse_args(int argc, char **argv) { exit(1); } ti.aspect_ratio = parse_aspect_ratio(argv[i + 1]); + ti.aspect_ratio_given = true; i++; } else if (!strcmp(argv[i], "-y") || !strcmp(argv[i], "--sync")) { @@ -1529,7 +1530,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 00a9d2500..79dc2d5fd 100644 --- a/src/pr_generic.cpp +++ b/src/pr_generic.cpp @@ -409,7 +409,7 @@ void generic_packetizer_c::set_headers() { GetChild(*track_entry); if ((hvideo_pixel_height != -1) && (hvideo_pixel_width != -1)) { - if (ti->aspect_ratio == 0.0) + if (!ti->aspect_ratio_given) ti->aspect_ratio = (float)hvideo_pixel_width / (float)hvideo_pixel_height; if (ti->aspect_ratio > diff --git a/src/pr_generic.h b/src/pr_generic.h index 01753b5e7..51560ee5e 100644 --- a/src/pr_generic.h +++ b/src/pr_generic.h @@ -89,6 +89,7 @@ typedef struct { char fourcc[5]; float aspect_ratio; + bool aspect_ratio_given; vector *audio_syncs; // As given on the command line audio_sync_t async; // For this very track