fix messed up cut/paste in thirdparty/Makefile / last checkin
[goodguy/history.git] / cinelerra-5.1 / cinelerra / mwindow.C
index ec4836175fc18d9033d205e6cb6429a49036ef01..44a7d00562bbaaa5a7565bc40d389e1f1de1bcbf 100644 (file)
@@ -400,13 +400,23 @@ const char *MWindow::default_std()
                }
        }
 
-       for( int i=0; ntsc_zones[i]; ++i ) {
-               if( !strcmp(ntsc_zones[i], p) )
-                       return "NTSC";
+       if( p ) {
+               for( int i=0; ntsc_zones[i]; ++i ) {
+                       if( !strcmp(ntsc_zones[i], p) )
+                               return "NTSC";
+               }
+       }
+
+       p = getenv("TZ");
+       if( p ) {
+               for( int i=0; ntsc_zones[i]; ++i ) {
+                       if( !strcmp(ntsc_zones[i], p) )
+                               return "NTSC";
+               }
        }
 
 //__timezone: Seconds west of UTC.  240sec/deg
-       double tz_deg = __timezone / 240.;
+       double tz_deg = -__timezone / 240.;
 // from Honolulu = -10, to New York = -5, 15deg/hr   lat -150..-75
        return tz_deg >= -10*15 && tz_deg <= -5*15 ? "NTSC" : "PAL";
 }
@@ -2915,6 +2925,9 @@ int MWindow::create_aspect_ratio(float &w, float &h, int width, int height)
 {
        w = 1;  h = 1;
        if(!width || !height) return 1;
+       if( width == 720 && (height == 480 || height == 576) ) {
+               w = 4;  h = 3;  return 0; // for NTSC and PAL
+       }
        double ar = (double)width / height;
 // square-ish pixels
        if( EQUIV(ar, 1.0000) ) return 0;