make inclusion/exclusion of hidden children optional in Item::add_child_bounding_boxes
[ardour.git] / gtk2_ardour / utils_videotl.cc
index 684bbf920c49832b7ba55269fd94bee81ac72937..d2bec87d9eba7b75950dc64ca28eae8f80233d13 100644 (file)
@@ -260,6 +260,7 @@ VideoUtils::video_query_info (
                double &video_aspect_ratio
                )
 {
+       LocaleGuard lg;
        char url[2048];
 
        snprintf(url, sizeof(url), "%s%sinfo/?file=%s&format=csv"
@@ -282,6 +283,12 @@ VideoUtils::video_query_info (
        video_aspect_ratio = atof (lines.at(0).at(3));
        video_file_fps = atof (lines.at(0).at(4));
        video_duration = atoll(lines.at(0).at(5));
+
+       if (video_aspect_ratio < 0.01 || video_file_fps < 0.01) {
+               /* catch errors early, aspect == 0 or fps == 0 will
+                * wreak havoc down the road */
+               return false;
+       }
        return true;
 }