summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--src/plparse/totem-disc.c15
-rw-r--r--src/totem-disc.c15
3 files changed, 24 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 88dd4a07d..a835db59e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-10-13 Bastien Nocera <hadess@hadess.net>
+
+ * src/totem-disc.c: (cd_cache_disc_is_vcd), (cd_cache_disc_is_dvd):
+ Fix detection of DVDs without an AUDIO_TS directory (Closes: #155281),
+ speed up the sub-dir checking in the DVD and VCD cases
+
============ Version 0.99.19
2004-10-13 Bastien Nocera <hadess@hadess.net>
diff --git a/src/plparse/totem-disc.c b/src/plparse/totem-disc.c
index 68d6c1b00..350e406b6 100644
--- a/src/plparse/totem-disc.c
+++ b/src/plparse/totem-disc.c
@@ -370,8 +370,10 @@ cd_cache_disc_is_vcd (CdCache *cache,
return MEDIA_TYPE_ERROR;
}
while ((name = g_dir_read_name (subdir)) != NULL) {
- if (g_ascii_strcasecmp (name, "avseq01.dat") == 0)
+ if (g_ascii_strcasecmp (name, "avseq01.dat") == 0) {
have_avseq = TRUE;
+ break;
+ }
}
g_dir_close (subdir);
g_free (subdirname);
@@ -390,7 +392,7 @@ cd_cache_disc_is_dvd (CdCache *cache,
{
GDir *dir;
const gchar *name;
- gboolean have_vts = FALSE, have_vtsifo = FALSE, have_ats = FALSE;
+ gboolean have_vts = FALSE, have_vtsifo = FALSE;
/* open disc, check capabilities and open mount */
if (!cd_cache_open_device (cache, error))
@@ -413,18 +415,19 @@ cd_cache_disc_is_dvd (CdCache *cache,
return MEDIA_TYPE_ERROR;
}
while ((name = g_dir_read_name (subdir)) != NULL) {
- if (g_ascii_strcasecmp (name, "VIDEO_TS.IFO") == 0)
+ if (g_ascii_strcasecmp (name, "VIDEO_TS.IFO") == 0) {
have_vtsifo = TRUE;
+ break;
+ }
}
g_dir_close (subdir);
g_free (subdirname);
- } else if (g_ascii_strcasecmp (name, "AUDIO_TS") == 0) {
- have_ats = TRUE;
+ break;
}
}
g_dir_close (dir);
- return (have_vts && have_ats && have_vtsifo) ?
+ return (have_vts && have_vtsifo) ?
MEDIA_TYPE_DVD : MEDIA_TYPE_DATA;
}
diff --git a/src/totem-disc.c b/src/totem-disc.c
index 68d6c1b00..350e406b6 100644
--- a/src/totem-disc.c
+++ b/src/totem-disc.c
@@ -370,8 +370,10 @@ cd_cache_disc_is_vcd (CdCache *cache,
return MEDIA_TYPE_ERROR;
}
while ((name = g_dir_read_name (subdir)) != NULL) {
- if (g_ascii_strcasecmp (name, "avseq01.dat") == 0)
+ if (g_ascii_strcasecmp (name, "avseq01.dat") == 0) {
have_avseq = TRUE;
+ break;
+ }
}
g_dir_close (subdir);
g_free (subdirname);
@@ -390,7 +392,7 @@ cd_cache_disc_is_dvd (CdCache *cache,
{
GDir *dir;
const gchar *name;
- gboolean have_vts = FALSE, have_vtsifo = FALSE, have_ats = FALSE;
+ gboolean have_vts = FALSE, have_vtsifo = FALSE;
/* open disc, check capabilities and open mount */
if (!cd_cache_open_device (cache, error))
@@ -413,18 +415,19 @@ cd_cache_disc_is_dvd (CdCache *cache,
return MEDIA_TYPE_ERROR;
}
while ((name = g_dir_read_name (subdir)) != NULL) {
- if (g_ascii_strcasecmp (name, "VIDEO_TS.IFO") == 0)
+ if (g_ascii_strcasecmp (name, "VIDEO_TS.IFO") == 0) {
have_vtsifo = TRUE;
+ break;
+ }
}
g_dir_close (subdir);
g_free (subdirname);
- } else if (g_ascii_strcasecmp (name, "AUDIO_TS") == 0) {
- have_ats = TRUE;
+ break;
}
}
g_dir_close (dir);
- return (have_vts && have_ats && have_vtsifo) ?
+ return (have_vts && have_vtsifo) ?
MEDIA_TYPE_DVD : MEDIA_TYPE_DATA;
}