changeset 4028:bb709f82068b

- Close dup()-ed file if ID3 file handling fails
author Ralf Ertzinger <ralf@skytale.net>
date Wed, 28 Nov 2007 16:49:24 +0100
parents 7d5c7b49aa03
children 76da6fe8cb39
files src/audacious/input.c src/libid3tag/file.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/input.c	Sun Nov 04 01:46:57 2007 +0200
+++ b/src/audacious/input.c	Wed Nov 28 16:49:24 2007 +0100
@@ -369,6 +369,7 @@
     /* cue:// cdda:// tone:// tact:// */
     if ((ip = uri_get_plugin(filename)) != NULL && ip->enabled)
     {
+        printf("Offering '%s' to %s, based on special URL scheme\n", filename, ip->description);
         if (ip->is_our_file != NULL)
             ret = ip->is_our_file(filename_proxy);
         else
@@ -402,6 +403,7 @@
     mimetype = vfs_get_metadata(fd, "content-type");
     if ((ip = mime_get_plugin(mimetype)) != NULL && ip->enabled)
     {
+        printf("Offering '%s' to %s, based on mime-type\n", filename, ip->description);
         if (ip->probe_for_tuple != NULL)
         {
             Tuple *tuple = ip->probe_for_tuple(filename_proxy, fd);
@@ -458,6 +460,8 @@
         if (!ip || !ip->enabled)
             continue;
 
+        printf("Offering '%s' to %s\n", filename, ip->description);
+
         vfs_rewind(fd);
 
         if (cfg.use_extension_probing == TRUE && ip->vfs_extensions != NULL &&
--- a/src/libid3tag/file.c	Sun Nov 04 01:46:57 2007 +0200
+++ b/src/libid3tag/file.c	Wed Nov 28 16:49:24 2007 +0100
@@ -494,6 +494,7 @@
   file = new_file(iofile, mode, path);
   if (file == 0){
     printf("id3_file_vfsopen: file failed\n");
+    aud_vfs_fclose(iofile);
   }
 
   aud_vfs_fseek(iofile, curpos, SEEK_SET);