diff src/flacng/plugin.c @ 1272:47559538ce3d

- stop read_metadata from stomping on the wrong file descriptors
author Ralf Ertzinger <ralf@skytale.net>
date Sun, 15 Jul 2007 15:00:10 +0200
parents 574ee15195f3
children a9a97179a1f9
line wrap: on
line diff
--- a/src/flacng/plugin.c	Fri Jul 13 21:31:17 2007 +0200
+++ b/src/flacng/plugin.c	Sun Jul 15 15:00:10 2007 +0200
@@ -184,7 +184,7 @@
         _LEAVE FALSE;
     }
 
-    _DEBUG("Testing file: %s", filename);
+    _DEBUG("Testing fd for file: %s", filename);
 
     if (FALSE == read_metadata(fd, test_decoder, test_info)) {
         _DEBUG("File not handled by this plugin!");
@@ -203,10 +203,7 @@
      * If we get here, the file is supported by FLAC.
      * The stream characteristics have been filled in by
      * the metadata callback.
-     * Do not close the stream, though.
      */
-     test_info->input_stream = NULL;
-
 
     _DEBUG("Stream encoded at %d Hz, %d bps, %d channels",
         test_info->stream.samplerate,
@@ -233,7 +230,7 @@
 
     _DEBUG("Accepting file %s", filename);
 
-    reset_info(test_info);
+    reset_info(test_info, FALSE);
 
     _LEAVE TRUE;
 }
@@ -683,7 +680,7 @@
         _ERROR("Could not read file info!");
         *length = -1;
         *title = g_strdup("");
-        vfs_fclose(fd);
+        reset_info(test_info, TRUE);
         _LEAVE;
     }
 
@@ -701,7 +698,7 @@
     *length = l;
     *title = get_title(filename, test_info);
 
-    reset_info(test_info);
+    reset_info(test_info, TRUE);
 
     _LEAVE;
 }
@@ -726,13 +723,13 @@
 
     if (FALSE == read_metadata(fd, test_decoder, test_info)) {
         _ERROR("Could not read metadata tuple for file <%s>", filename);
-        vfs_fclose(fd);
+        reset_info(test_info, TRUE);
         _LEAVE NULL;
     }
 
     tuple = get_tuple(filename, test_info);
 
-    reset_info(test_info);
+    reset_info(test_info, TRUE);
 
     _LEAVE tuple;
 }