changeset 91:6e1002ea4ded trunk

[svn] - some seek code (can't be implemented right now though) - change `return 1' to `return NULL' in decode_thread().
author nenolod
date Thu, 12 Oct 2006 09:05:01 -0700
parents 77e8e032601b
children fadf346ddde3
files ChangeLog src/alac/plugin.c
diffstat 2 files changed, 28 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Oct 12 06:21:12 2006 -0700
+++ b/ChangeLog	Thu Oct 12 09:05:01 2006 -0700
@@ -1,3 +1,11 @@
+2006-10-12 13:21:12 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
+  revision [180]
+  - fix for lock contention on saving m3u. locking playlist has been done in playlist_save().
+  
+  trunk/src/m3u/m3u.c |    4 ----
+  1 file changed, 4 deletions(-)
+
+
 2006-10-12 12:04:58 +0000  William Pitcock <nenolod@nenolod.net>
   revision [178]
   - some fixes via alxorlov on the forums
--- a/src/alac/plugin.c	Thu Oct 12 06:21:12 2006 -0700
+++ b/src/alac/plugin.c	Thu Oct 12 09:05:01 2006 -0700
@@ -49,6 +49,7 @@
 gpointer decode_thread(void *args);
 static GThread *playback_thread;
 static int going = 0;
+static int seek_to = -1;
 
 extern void set_endian();
 
@@ -189,7 +190,7 @@
 
 static void seek(gint time)
 {
-	/* unimplemented */
+    seek_to = time;
 }
 
 static gint get_time(void)
@@ -277,6 +278,22 @@
 
         int outputBytes;
 
+#if 0
+	/* XXX: Horribly inaccurate seek. -nenolod */
+	if (seek_to != -1)
+	{
+	    gulong duration =
+		(demux_res->num_sample_byte_sizes * (float)((1024 * demux_res->sample_size) - 1.0) /
+	       		(float)(demux_res->sample_rate / 251));
+
+	    i = (duration - seek_to) / demux_res->num_sample_byte_sizes;
+
+	    g_print("seek to ALAC frame: %d\n", i);
+
+	    seek_to = -1;
+	}
+#endif
+
         /* just get one sample for now */
         if (!get_sample_info(demux_res, i,
                              &sample_duration, &sample_byte_size))
@@ -320,12 +337,12 @@
     input_stream = stream_create_file(input_file, 1);
 
     if (!input_stream)
-        return 1;
+        return NULL;
 
     /* if qtmovie_read returns successfully, the stream is up to
      * the movie data, which can be used directly by the decoder */
     if (!qtmovie_read(input_stream, &demux_res))
-        return 1;
+        return NULL;
 
     demux_res.stream = input_stream;