changeset 524:bb7312f3ec1a trunk

[svn] - flac 112 plugin: last fix; hopefully, everything is ok now; for both 112 and 113 playback works and http stream works
author giacomo
date Mon, 22 Jan 2007 13:35:34 -0800
parents 221086196f89
children c91f3d7cd641
files ChangeLog src/flac112/plugin.c
diffstat 2 files changed, 34 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jan 22 13:30:28 2007 -0800
+++ b/ChangeLog	Mon Jan 22 13:35:34 2007 -0800
@@ -1,3 +1,12 @@
+2007-01-22 21:30:28 +0000  Giacomo Lozito <james@develia.org>
+  revision [1132]
+  - 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
+  trunk/src/flac113/fileinfo.c |    5 +++++
+  trunk/src/flac113/plugin.c   |    3 ---
+  trunk/src/flac113/tag.c      |    9 ++++++++-
+  3 files changed, 13 insertions(+), 4 deletions(-)
+
+
 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
--- a/src/flac112/plugin.c	Mon Jan 22 13:30:28 2007 -0800
+++ b/src/flac112/plugin.c	Mon Jan 22 13:35:34 2007 -0800
@@ -403,33 +403,38 @@
 
 void FLAC_XMMS__get_song_info(char *filename, char **title, int *length_in_msec)
 {
-	/* NOTE vfs is not yet used here, so only try
+	FLAC__StreamMetadata streaminfo;
+
+	/* 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) )
 	{
-		FLAC__StreamMetadata streaminfo;
-		if(!FLAC__metadata_get_streaminfo(filename, &streaminfo)) {
-			/* @@@ how to report the error? */
-			if(title) {
-				if (source_to_decoder_type (filename) == DECODER_FILE) {
-					static const char *errtitle = "Invalid FLAC File: ";
-					*title = g_malloc(strlen(errtitle) + 1 + strlen(filename) + 1 + 1);
-					sprintf(*title, "%s\"%s\"", errtitle, filename);
-				} else {
-					*title = NULL;
-				}
+		*title = g_strdup(filename);
+		*length_in_msec = -1;
+		return;
+	}
+
+	if(!FLAC__metadata_get_streaminfo(filename, &streaminfo)) {
+		/* @@@ how to report the error? */
+		if(title) {
+			if (source_to_decoder_type (filename) == DECODER_FILE) {
+				static const char *errtitle = "Invalid FLAC File: ";
+				*title = g_malloc(strlen(errtitle) + 1 + strlen(filename) + 1 + 1);
+				sprintf(*title, "%s\"%s\"", errtitle, filename);
+			} else {
+				*title = NULL;
 			}
-			if(length_in_msec)
-				*length_in_msec = -1;
-			return;
-		}
-
-		if(title) {
-			*title = flac_format_song_title(filename);
 		}
 		if(length_in_msec)
-			*length_in_msec = (unsigned)((double)streaminfo.data.stream_info.total_samples / (double)streaminfo.data.stream_info.sample_rate * 1000.0 + 0.5);
+			*length_in_msec = -1;
+		return;
 	}
+
+	if(title) {
+		*title = flac_format_song_title(filename);
+	}
+	if(length_in_msec)
+		*length_in_msec = (unsigned)((double)streaminfo.data.stream_info.total_samples / (double)streaminfo.data.stream_info.sample_rate * 1000.0 + 0.5);
 }
 
 /***********************************************************************