Added a flag "aspect_ratio_given" so that aspect_ratio itself can be set to whatever is necessary while retaining the information about the cmdline.

This commit is contained in:
Moritz Bunkus 2003-08-11 21:58:21 +00:00
parent ed95388324
commit 086d8727a3
3 changed files with 4 additions and 2 deletions

View File

@ -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<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>;

View File

@ -409,7 +409,7 @@ 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)
if (!ti->aspect_ratio_given)
ti->aspect_ratio = (float)hvideo_pixel_width /
(float)hvideo_pixel_height;
if (ti->aspect_ratio >

View File

@ -89,6 +89,7 @@ typedef struct {
char fourcc[5];
float aspect_ratio;
bool aspect_ratio_given;
vector<audio_sync_t> *audio_syncs; // As given on the command line
audio_sync_t async; // For this very track