OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / gtk / src / hb-backend.c
index 5922877..9527977 100644 (file)
@@ -2,7 +2,7 @@
  *            hb-backend.c
  *
  *  Fri Mar 28 10:38:44 2008
- *  Copyright  2008  John Stebbins
+ *  Copyright  2008-2011  John Stebbins
  *  <john at stebbins dot name>
  ****************************************************************************/
 
@@ -4096,6 +4096,10 @@ ghb_select_audio_codec(GValue *settings, hb_audio_config_t *aconfig, gint acodec
                {
                        return HB_ACODEC_AC3;
                }
+               else if (acodec & HB_ACODEC_LAME)
+               {
+                       return HB_ACODEC_LAME;
+               }
                else if (acodec & HB_ACODEC_FAAC)
                {
                        return HB_ACODEC_FAAC;
@@ -4335,11 +4339,28 @@ ghb_validate_vquality(GValue *settings)
                                max = 62;
                        } break;
                }
-               if (vquality < min || vquality > max)
+               if (vcodec == HB_VCODEC_X264 && vquality == 0.0)
+               {
+                       message = g_strdup_printf(
+                                               "Warning: lossless h.264 selected\n\n"
+                                               "Lossless h.264 is not well supported by\n"
+                                               "many players and editors.\n\n"
+                        "It will produce enormous output files.\n\n"
+                                               "Are you sure you wish to use this setting?",
+                                               (gint)vquality, min, max);
+                       if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, 
+                                                                       "Cancel", "Continue"))
+                       {
+                               g_free(message);
+                               return FALSE;
+                       }
+                       g_free(message);
+               }
+               else if (vquality < min || vquality > max)
                {
                        message = g_strdup_printf(
-                                               "Interesting video quality choise: %d\n\n"
-                                               "Typical values range from %d to %d.\n"
+                                               "Interesting video quality choice: %d\n\n"
+                                               "Typical values range from %d to %d.\n\n"
                                                "Are you sure you wish to use this setting?",
                                                (gint)vquality, min, max);
                        if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message, 
@@ -4722,8 +4743,10 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
                        sub_config.offset = ghb_settings_get_int(ssettings, "SrtOffset");
                        lang = ghb_settings_get_string(ssettings, "SrtLanguage");
                        code = ghb_settings_get_string(ssettings, "SrtCodeset");
-                       strncpy(sub_config.src_filename, filename, 128);
-                       strncpy(sub_config.src_codeset, code, 40);
+                       strncpy(sub_config.src_filename, filename, 255);
+                       sub_config.src_filename[255] = 0;
+                       strncpy(sub_config.src_codeset, code, 39);
+                       sub_config.src_codeset[39] = 0;
                        sub_config.force = 0;
                        sub_config.dest = PASSTHRUSUB;
                        sub_config.default_track = def;