OSDN Git Service

MacGui: Remove Target Size as a rate control option as it doesn't really work correct...
[handbrake-jp/handbrake-jp-git.git] / gtk / src / main.c
index 7e62d60..72617eb 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
 /*
  * main.c
- * Copyright (C) John Stebbins 2008 <stebbins@stebbins>
+ * Copyright (C) John Stebbins 2008-2011 <stebbins@stebbins>
  * 
  * main.c is free software.
  * 
 
 #include <gtk/gtk.h>
 
-#if !defined(_WIN32)
+#if defined(_ENABLE_GST)
 #include <gst/gst.h>
+#endif
+
+#if !defined(_WIN32)
 #include <libnotify/notify.h>
 #include <dbus/dbus-glib.h>
 #else
@@ -716,10 +719,6 @@ watch_volumes(signal_user_data_t *ud)
 #endif
 }
 
-// Hack to avoid a segfault in libavcodec
-extern int mm_flags;
-int mm_support();
-
 G_MODULE_EXPORT void x264_entry_changed_cb(GtkWidget *widget, signal_user_data_t *ud);
 void preview_window_expose_cb(void);
 
@@ -765,7 +764,6 @@ main (int argc, char *argv[])
        GError *error = NULL;
        GOptionContext *context;
 
-       mm_flags = mm_support();
 #ifdef ENABLE_NLS
        bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -777,11 +775,16 @@ main (int argc, char *argv[])
        context = g_option_context_new ("- Rip and encode DVD or MPEG file");
        g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
        g_option_context_add_group (context, gtk_get_option_group (TRUE));
-#if !defined(_WIN32)
+#if defined(_ENABLE_GST)
        g_option_context_add_group (context, gst_init_get_option_group ());
 #endif
        g_option_context_parse (context, &argc, &argv, &error);
        g_option_context_free(context);
+
+       if (argc > 1 && dvd_device == NULL && argv[1][0] != '-')
+       {
+               dvd_device = argv[1];
+       }
        
        gtk_set_locale ();
        gtk_init (&argc, &argv);
@@ -918,7 +921,8 @@ main (int argc, char *argv[])
        if (dvd_device != NULL)
        {
                // Source overridden from command line option
-               ghb_settings_set_string(ud->settings, "source", dvd_device);
+               ghb_settings_set_string(ud->settings, "scan_source", dvd_device);
+               g_idle_add((GSourceFunc)ghb_idle_scan, ud);
        }
        // Reload and check status of the last saved queue
        g_idle_add((GSourceFunc)ghb_reload_queue, ud);