- m_view.clip_ar->setEnabled(true);
- m_view.clip_ar->setValue(props.value("force_aspect_ratio").toDouble());
- } else if (props.contains("aspect_ratio")) m_view.clip_ar->setValue(props.value("aspect_ratio").toDouble());
+ m_view.clip_ar_num->setEnabled(true);
+ m_view.clip_ar_den->setEnabled(true);
+ m_view.clip_ar_num->setValue(props.value("force_aspect_num").toInt());
+ m_view.clip_ar_den->setValue(props.value("force_aspect_den").toInt());
+ }
+ // Legacy support for pixel aspect ratio
+ else if (props.contains("force_aspect_ratio") && props.value("force_aspect_ratio").toDouble() > 0) {
+ m_view.clip_force_ar->setChecked(true);
+ m_view.clip_ar_num->setEnabled(true);
+ m_view.clip_ar_den->setEnabled(true);
+ if (props.contains("frame_size")) {
+ int width = props.value("force_aspect_ratio").toDouble() * props.value("frame_size").section('x', 0, 0).toInt();
+ int height = props.value("frame_size").section('x', 1, 1).toInt();
+ if (width > 0 && height > 0) {
+ if ((width / height * 100) == 133) {
+ width = 4;
+ height = 3;
+ }
+ else if (int(width / height * 100) == 177) {
+ width = 16;
+ height = 9;
+ }
+ m_view.clip_ar_num->setValue(width);
+ m_view.clip_ar_den->setValue(height);
+ }
+ }
+ }