mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
Video aspect ratio was set wrong if the user did not specify any.
This commit is contained in:
parent
8eb9a84c21
commit
81a4fec5db
@ -1,5 +1,10 @@
|
||||
2003-08-11 Moritz Bunkus <moritz@bunkus.org>
|
||||
|
||||
* 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
|
||||
|
@ -1039,7 +1039,7 @@ static void identify(const char *filename) {
|
||||
ti.languages = new vector<language_t>;
|
||||
ti.sub_charsets = new vector<language_t>;
|
||||
ti.all_tags = new vector<tags_t>;
|
||||
ti.aspect_ratio = 1.0;
|
||||
ti.aspect_ratio = 0.0;
|
||||
ti.atracks = new vector<int64_t>;
|
||||
ti.vtracks = new vector<int64_t>;
|
||||
ti.stracks = new vector<int64_t>;
|
||||
@ -1096,7 +1096,7 @@ static void parse_args(int argc, char **argv) {
|
||||
ti.languages = new vector<language_t>;
|
||||
ti.sub_charsets = new vector<language_t>;
|
||||
ti.all_tags = new vector<tags_t>;
|
||||
ti.aspect_ratio = 1.0;
|
||||
ti.aspect_ratio = 0.0;
|
||||
ti.atracks = new vector<int64_t>;
|
||||
ti.vtracks = new vector<int64_t>;
|
||||
ti.stracks = new vector<int64_t>;
|
||||
|
@ -409,6 +409,9 @@ void generic_packetizer_c::set_headers() {
|
||||
GetChild<KaxTrackVideo>(*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);
|
||||
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user