changeset 1526:56b0d46a02f6

wavpack: Implement InputPlugin::probe_for_tuple.
author William Pitcock <nenolod@atheme-project.org>
date Sat, 25 Aug 2007 20:22:33 -0500
parents ff7d0178ba8e
children 8a53b54fc081
files src/wavpack/libwavpack.cxx
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/wavpack/libwavpack.cxx	Fri Aug 24 21:06:08 2007 +0300
+++ b/src/wavpack/libwavpack.cxx	Sat Aug 25 20:22:33 2007 -0500
@@ -34,6 +34,7 @@
 
 static void wv_load_config();
 static int wv_is_our_fd(gchar *filename, VFSFile *file);
+static Tuple *wv_probe_for_tuple(gchar *filename, VFSFile *file);
 static void wv_play(InputPlayback *);
 static void wv_stop(InputPlayback *);
 static void wv_pause(InputPlayback *, short);
@@ -90,6 +91,8 @@
     NULL,
     wv_is_our_fd,
     (gchar **)wv_fmts,
+    NULL,			// high precision seeking
+    wv_probe_for_tuple		// probe for a tuple
 };
 
 int32_t read_bytes (void *id, void *data, int32_t bcount)
@@ -447,6 +450,20 @@
     return ti;
 }
 
+static Tuple *
+wv_probe_for_tuple(gchar *filename, VFSFile *file)
+{
+    Tuple *ti;
+    WavpackDecoder d(&mod);
+
+    if (!d.attach(filename, file))
+        return NULL;
+
+    ti = tuple_from_WavpackContext(filename, d.ctx);
+
+    return ti;
+}
+
 static void
 wv_get_song_info(char *filename, char **title, int *length)
 {