fixes to mask, keyfrmpopup, listbox; update ver for build
[goodguy/history.git] / cinelerra-5.1 / cinelerra / filempeg.C
index cef98f4dab2df6629b2ff85af1a385ac71efeca7..c34cc731307ade5dbb526a1000bcdc875d4b24e3 100644 (file)
@@ -490,9 +490,9 @@ int FileMPEG::open_file(int rd, int wr)
 // Construct command line
                        if(!result)
                        {
-                               char string[BCTEXTLEN];
-                               get_exe_path(string);
-                               sprintf(mjpeg_command, "%s/%s", string, HVPEG_EXE);
+                               const char *exec_path = File::get_cinlib_path();
+                               sprintf(mjpeg_command, "%s/%s", exec_path, HVPEG_EXE);
+                               append_vcommand_line(mjpeg_command);
 
                                if(asset->aspect_ratio > 0)
                                {
@@ -516,7 +516,7 @@ int FileMPEG::open_file(int rd, int wr)
                                append_vcommand_line(asset->vmpeg_cmodel == BC_YUV422P ? "-422" : "");
                                if(asset->vmpeg_fix_bitrate)
                                {
-                                       append_vcommand_line("--cbr -b");
+                                       append_vcommand_line("-b");
                                        append_vcommand_line(bitrate_string);
                                }
                                else
@@ -540,9 +540,8 @@ int FileMPEG::open_file(int rd, int wr)
 // mjpegtools encoder
 //  this one is cinelerra-x.x.x/thirdparty/mjpegtools/mpeg2enc
                {
-                       char string[BCTEXTLEN];
-                       get_exe_path(string);
-                       sprintf(mjpeg_command, "%s/%s -v 0 ", string, MJPEG_EXE);
+                       const char *exec_path = File::get_cinlib_path();
+                       sprintf(mjpeg_command, "%s/%s -v 0 ", exec_path, MJPEG_EXE);
 
 // Must disable interlacing if MPEG-1
                        switch (asset->vmpeg_preset)
@@ -555,6 +554,7 @@ int FileMPEG::open_file(int rd, int wr)
 // Be quiet
                        strcat(mjpeg_command, " -v0");
 
+                       char string[BCTEXTLEN];
 // The current usage of mpeg2enc requires bitrate of 0 when quantization is fixed and
 // quantization of 1 when bitrate is fixed.  Perfectly intuitive.
                        if(asset->vmpeg_fix_bitrate)
@@ -2089,17 +2089,6 @@ void MPEGConfigVideo::update_cmodel_objs()
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
 MPEGDerivative::MPEGDerivative(int x, int y, MPEGConfigVideo *gui)
  : BC_PopupMenu(x, y, 150, derivative_to_string(gui->asset->vmpeg_derivative))
 {
@@ -2120,42 +2109,21 @@ int MPEGDerivative::handle_event()
 
 int MPEGDerivative::string_to_derivative(char *string)
 {
-       if(!strcasecmp(derivative_to_string(1), string))
-               return 1;
-       if(!strcasecmp(derivative_to_string(2), string))
-               return 2;
-
+       if( !strcasecmp(derivative_to_string(1), string) ) return 1;
+       if( !strcasecmp(derivative_to_string(2), string) ) return 2;
        return 1;
 }
 
 char* MPEGDerivative::derivative_to_string(int derivative)
 {
-       switch(derivative)
-       {
-               case 1:
-                       return _("MPEG-1");
-                       break;
-
-               case 2:
-                       return _("MPEG-2");
-                       break;
-
-               default:
-                       return _("MPEG-1");
-                       break;
+       switch(derivative) {
+       case 1: return _("MPEG-1");
+       case 2: return _("MPEG-2");
        }
+       return _("MPEG-1");
 }
 
 
-
-
-
-
-
-
-
-
-
 MPEGPreset::MPEGPreset(int x, int y, MPEGConfigVideo *gui)
  : BC_PopupMenu(x, y, 200, value_to_string(gui->asset->vmpeg_preset))
 {
@@ -2164,8 +2132,7 @@ MPEGPreset::MPEGPreset(int x, int y, MPEGConfigVideo *gui)
 
 void MPEGPreset::create_objects()
 {
-       for(int i = 0; i < 10; i++)
-       {
+       for(int i = 0; i < 14; i++) {
                add_item(new BC_MenuItem(value_to_string(i)));
        }
 }
@@ -2178,8 +2145,7 @@ int MPEGPreset::handle_event()
 
 int MPEGPreset::string_to_value(char *string)
 {
-       for(int i = 0; i < 10; i++)
-       {
+       for(int i = 0; i < 14; i++) {
                if(!strcasecmp(value_to_string(i), string))
                        return i;
        }
@@ -2188,20 +2154,23 @@ int MPEGPreset::string_to_value(char *string)
 
 char* MPEGPreset::value_to_string(int derivative)
 {
-       switch(derivative)
-       {
-               case 0: return _("Generic MPEG-1"); break;
-               case 1: return _("standard VCD"); break;
-               case 2: return _("user VCD"); break;
-               case 3: return _("Generic MPEG-2"); break;
-               case 4: return _("standard SVCD"); break;
-               case 5: return _("user SVCD"); break;
-               case 6: return _("VCD Still sequence"); break;
-               case 7: return _("SVCD Still sequence"); break;
-               case 8: return _("DVD NAV"); break;
-               case 9: return _("DVD"); break;
-               default: return _("Generic MPEG-1"); break;
+       switch( derivative ) {
+       case 0: return _("Generic MPEG-1"); break;
+       case 1: return _("standard VCD"); break;
+       case 2: return _("user VCD"); break;
+       case 3: return _("Generic MPEG-2"); break;
+       case 4: return _("standard SVCD"); break;
+       case 5: return _("user SVCD"); break;
+       case 6: return _("VCD Still sequence"); break;
+       case 7: return _("SVCD Still sequence"); break;
+       case 8: return _("DVD NAV"); break;
+       case 9: return _("DVD"); break;
+       case 10: return _("ATSC 480i"); break;
+       case 11: return _("ATSC 480p"); break;
+       case 12: return _("ATSC 720p"); break;
+       case 13: return _("ATSC 1080i"); break;
        }
+       return _("Generic MPEG-1");
 }