- Timestamp:
- 05/17/08 21:58:20 (6 months ago)
- Files:
-
- trunk/MatroskaImportPrivate.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/MatroskaImportPrivate.cpp
r863 r877 409 409 // some files ignore the spec and treat display width/height as a ratio, not as pixels 410 410 // so scale the display size to be at least as large as the pixel size here 411 // but don't let it be bigger in both dimensions 411 412 float horizRatio = float(uint32(pxl_width)) / uint32(disp_width); 412 413 float vertRatio = float(uint32(pxl_height)) / uint32(disp_height); … … 419 420 height = FloatToFixed(uint32(disp_height) * horizRatio); 420 421 } else { 421 width = IntToFixed(uint32(disp_width)); 422 height = IntToFixed(uint32(disp_height)); 422 float dar = uint32(disp_width) / (float)uint32(disp_height); 423 float p_ratio = uint32(pxl_width) / (float)uint32(pxl_height); 424 425 if (dar > p_ratio) { 426 width = FloatToFixed(uint32(pxl_height) * dar); 427 height = IntToFixed(uint32(pxl_height)); 428 } else { 429 width = IntToFixed(uint32(pxl_width)); 430 height = FloatToFixed(uint32(pxl_width) / dar); 431 } 423 432 } 424 433 } else if (pxl_width.ValueIsSet() && pxl_height.ValueIsSet()) {
