changeset 1259:0423885a75f8 trunk

[svn] - I hate libflac's inconsistent API!
author nenolod
date Thu, 15 Jun 2006 18:41:54 -0700
parents 74aa6a352a0c
children bf0664762d4a
files ChangeLog Plugins/Input/flac/tag.c
diffstat 2 files changed, 14 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jun 15 18:37:15 2006 -0700
+++ b/ChangeLog	Thu Jun 15 18:41:54 2006 -0700
@@ -1,3 +1,12 @@
+2006-06-16 01:37:15 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [1430]
+  - flac_get_tuple(): properly calculate length. oops!
+  
+
+  Changes:        Modified:
+  +1 -0           trunk/Plugins/Input/flac/tag.c  
+
+
 2006-06-16 00:42:59 +0000  George Averill <nhjm449@gmail.com>
   revision [1428]
   - Don't leave files open after reading their tags!
--- a/Plugins/Input/flac/tag.c	Thu Jun 15 18:37:15 2006 -0700
+++ b/Plugins/Input/flac/tag.c	Thu Jun 15 18:41:54 2006 -0700
@@ -89,6 +89,7 @@
 {
 	TitleInput *input = NULL;
 	FLAC__StreamMetadata *tags;
+	FLAC__StreamMetadata info;
 	char *title, *artist, *performer, *album, *date, *tracknumber, *genre, *description;
 	gchar *filename_proxy = g_strdup(filename);
 
@@ -118,7 +119,10 @@
 	input->file_name = g_path_get_basename(filename_proxy);
 	input->file_path = filename_proxy;
 	input->file_ext = local__extname(filename_proxy);
-	input->length = (unsigned)((double)tags->data.stream_info.total_samples / (double)tags->data.stream_info.sample_rate * 1000.0 + 0.5);
+
+        FLAC__metadata_get_streaminfo(filename, &info);
+
+	input->length = (unsigned)((double)info.data.stream_info.total_samples / (double)info.data.stream_info.sample_rate * 1000.0 + 0.5);
 
 	return input;
 }