changeset 523:221086196f89 trunk

[svn] - flac 113 plugin: do not try to pick tuple from file if file is not accessible via stdio (and stop crashing when such attempts are done); TODO: pick tags from flac via vfs
author giacomo
date Mon, 22 Jan 2007 13:30:28 -0800
parents 2d3fad6a3842
children bb7312f3ec1a
files ChangeLog src/flac113/fileinfo.c src/flac113/plugin.c src/flac113/tag.c
diffstat 4 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jan 22 12:32:00 2007 -0800
+++ b/ChangeLog	Mon Jan 22 13:30:28 2007 -0800
@@ -1,3 +1,12 @@
+2007-01-22 20:32:00 +0000  Giacomo Lozito <james@develia.org>
+  revision [1130]
+  - flac 112 plugin: do not try to pick tuple from file if file is not accessible via stdio (and stop crashing when such attempts are done); TODO: pick tags from flac via vfs
+  trunk/src/flac112/fileinfo.c |    5 +++++
+  trunk/src/flac112/plugin.c   |   43 ++++++++++++++++++++++---------------------
+  trunk/src/flac112/tag.c      |    9 ++++++++-
+  3 files changed, 35 insertions(+), 22 deletions(-)
+
+
 2007-01-22 20:21:31 +0000  Giacomo Lozito <james@develia.org>
   revision [1128]
   - refinements for getc/ungetc in curl
--- a/src/flac113/fileinfo.c	Mon Jan 22 12:32:00 2007 -0800
+++ b/src/flac113/fileinfo.c	Mon Jan 22 13:30:28 2007 -0800
@@ -282,6 +282,11 @@
 	gchar *title;
 	gchar *filename_utf8;
 
+	/* NOTE vfs is not used here, so only try
+	   to pick tags if you can do it with flac library stdio */
+	if ( strncmp(filename,"/",1) )
+		return;
+
 	if (!window)
 	{
 		GtkWidget *vbox, *hbox, *left_vbox, *table;
--- a/src/flac113/plugin.c	Mon Jan 22 12:32:00 2007 -0800
+++ b/src/flac113/plugin.c	Mon Jan 22 13:30:28 2007 -0800
@@ -399,9 +399,6 @@
 {
 	FLAC__StreamMetadata streaminfo;
 
-	if(0 == filename)
-		filename = "";
-
 	/* NOTE vfs is not used here, so only try
 	   to pick tags if you can do it with flac library stdio */
 	if ( strncmp(filename,"/",1) )
--- a/src/flac113/tag.c	Mon Jan 22 12:32:00 2007 -0800
+++ b/src/flac113/tag.c	Mon Jan 22 13:30:28 2007 -0800
@@ -91,7 +91,14 @@
 	FLAC__StreamMetadata *tags;
 	FLAC__StreamMetadata info;
 	char *title, *artist, *performer, *album, *date, *tracknumber, *genre, *description;
-	gchar *filename_proxy = g_strdup(filename);
+	gchar *filename_proxy;
+
+	/* NOTE vfs is not yet used here, so only try
+	   to pick tags if you can do it with flac library stdio */
+	if ( strncmp(filename,"/",1) )
+		return NULL;
+
+	filename_proxy = g_strdup(filename);
 
 	FLAC_plugin__tags_get(filename_proxy, &tags);