changeset 488:5e375eca97da trunk

[svn] - flac 113 plugin: allow to do seek and other operations on http sources
author giacomo
date Sun, 21 Jan 2007 11:17:52 -0800
parents f541940d5475
children ce4efa148521
files ChangeLog src/flac113/plugin.c
diffstat 2 files changed, 15 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Jan 21 11:00:54 2007 -0800
+++ b/ChangeLog	Sun Jan 21 11:17:52 2007 -0800
@@ -1,3 +1,10 @@
+2007-01-21 19:00:54 +0000  Giacomo Lozito <james@develia.org>
+  revision [1060]
+  - flac 113 plugin: placed a label in configure dialog, explaning that stream options are currently ignored
+  trunk/src/flac113/configure.c |   14 ++++++++++----
+  1 file changed, 10 insertions(+), 4 deletions(-)
+
+
 2007-01-21 18:40:40 +0000  Giacomo Lozito <james@develia.org>
   revision [1058]
   - flac 113 plugin: moved to vfs for file detection and playback; plays http files as well, but it does not use flac/http.c code to do it, so there's no metadata parsing and flac http options are ignored; flac tags are still read directly from stdio, with checks that prevents tag reading if file is not stdio-readable
--- a/src/flac113/plugin.c	Sun Jan 21 11:00:54 2007 -0800
+++ b/src/flac113/plugin.c	Sun Jan 21 11:17:52 2007 -0800
@@ -396,13 +396,11 @@
 
 void FLAC_XMMS__seek(int time)
 {
-	if(!stream_data_.is_http_source) {
-		stream_data_.seek_to_in_sec = time;
-		stream_data_.eof = false;
+	stream_data_.seek_to_in_sec = time;
+	stream_data_.eof = false;
 
-		while(stream_data_.seek_to_in_sec != -1)
-			xmms_usleep(10000);
-	}
+	while(stream_data_.seek_to_in_sec != -1)
+		xmms_usleep(10000);
 }
 
 int FLAC_XMMS__get_time()
@@ -522,7 +520,7 @@
 				}
 				blocksize = sample_buffer_last_ - sample_buffer_first_ - s;
 				decode_position_frame_last = decode_position_frame;
-				if(stream_data_.is_http_source || !FLAC__stream_decoder_get_decode_position(decoder_, &decode_position_frame))
+				if(!FLAC__stream_decoder_get_decode_position(decoder_, &decode_position_frame))
 					decode_position_frame = 0;
 			}
 			if(sample_buffer_last_ - sample_buffer_first_ > 0) {
@@ -561,7 +559,7 @@
 		}
 		else
 			xmms_usleep(10000);
-		if(!stream_data_.is_http_source && stream_data_.seek_to_in_sec != -1) {
+		if(stream_data_.seek_to_in_sec != -1) {
 			const double distance = (double)stream_data_.seek_to_in_sec * 1000.0 / (double)stream_data_.length_in_msec;
 			FLAC__uint64 target_sample = (FLAC__uint64)(distance * (double)stream_data_.total_samples);
 			if(stream_data_.total_samples > 0 && target_sample >= stream_data_.total_samples)
@@ -765,8 +763,7 @@
 	stream_data_struct *stream_data = (stream_data_struct *)client_data;
 	(void)decoder;
 
-	if ( stream_data->is_http_source )
-		return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED;
+	g_print("SEEK\n");
 
 	if ( vfs_fseek( stream_data->vfsfile , (glong)absolute_byte_offset , SEEK_SET ) < 0 )
 		return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
@@ -780,9 +777,6 @@
 	glong pos;
 	(void)decoder;
 
-	if ( stream_data->is_http_source )
-		return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED;
-
 	if ( (pos = vfs_ftell(stream_data->vfsfile)) < 0 )
 		return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
 	else
@@ -799,9 +793,6 @@
 	glong length = 0;
 	(void)decoder;
 
-	if ( stream_data->is_http_source )
-		return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED;
-
 	current_pos = vfs_ftell(stream_data->vfsfile);
 	if ( current_pos < 0 )
 		return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
@@ -828,8 +819,5 @@
 	stream_data_struct *stream_data = (stream_data_struct *)client_data;
 	(void)decoder;
 
-	if ( stream_data->is_http_source )
-		return FALSE;
-	else
-		return vfs_feof( stream_data->vfsfile );
+	return vfs_feof( stream_data->vfsfile );
 }