summaryrefslogtreecommitdiffstats
path: root/gtk/src/ghb-dvd.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-04-16 01:46:08 +0000
committerjstebbins <[email protected]>2009-04-16 01:46:08 +0000
commitabbb574581cf09d09605e5acc2eef96c2fba1657 (patch)
treef8b18a1c9a4219d6b33981733f42792054febb3b /gtk/src/ghb-dvd.c
parente47c45909f0e02f1267331b095521f66ba216f41 (diff)
LinGui: merge gtk mingw cross compiling support
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2332 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/ghb-dvd.c')
-rw-r--r--gtk/src/ghb-dvd.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gtk/src/ghb-dvd.c b/gtk/src/ghb-dvd.c
index c20b8fa3e..1d3422caf 100644
--- a/gtk/src/ghb-dvd.c
+++ b/gtk/src/ghb-dvd.c
@@ -37,6 +37,10 @@
* Free Software Foundation version 2 of the License.
*/
+#if defined(_WIN32)
+#include <windows.h>
+#endif
+
#include <glib.h>
#include <gio/gio.h>
@@ -315,7 +319,6 @@ ghb_dvd_volname(const gchar *device)
}
#endif
-#if defined(__linux__)
gchar*
ghb_resolve_symlink(const gchar *name)
{
@@ -359,12 +362,11 @@ ghb_resolve_symlink(const gchar *name)
g_object_unref(gfile);
return file;
}
-#endif
void
ghb_dvd_set_current(const gchar *name, signal_user_data_t *ud)
{
-#if defined(__linux__)
+#if !defined(_WIN32)
GFile *gfile;
GFileInfo *info;
gchar *resolved = ghb_resolve_symlink(name);
@@ -395,11 +397,19 @@ ghb_dvd_set_current(const gchar *name, signal_user_data_t *ud)
}
g_object_unref(gfile);
#else
+ gchar drive[4];
+ guint dtype;
+
if (ud->current_dvd_device != NULL)
{
g_free(ud->current_dvd_device);
ud->current_dvd_device = NULL;
}
- ud->current_dvd_device = g_strdup(name);;
+ g_strlcpy(drive, name, 4);
+ dtype = GetDriveType(drive);
+ if (dtype == DRIVE_CDROM)
+ {
+ ud->current_dvd_device = g_strdup(name);
+ }
#endif
}