diff src/madplug/input.c @ 776:8366ad444313 trunk

[svn] - by unknown reason, http connection via proxy server needs a transfer stop after tag retrieving.
author yaz
date Sat, 03 Mar 2007 17:36:01 -0800
parents a24cc8848b9a
children 83a38bcfe7c8
line wrap: on
line diff
--- a/src/madplug/input.c	Sat Mar 03 05:55:23 2007 -0800
+++ b/src/madplug/input.c	Sat Mar 03 17:36:01 2007 -0800
@@ -352,6 +352,7 @@
 {
     gchar *string = NULL;
     TitleInput *title_input;
+    glong curpos;
 
 #ifdef DEBUG
     g_message("f: input_read_tag");
@@ -363,8 +364,10 @@
     else
         title_input = info->tuple;
 
-    if(info->infile)
+    if(info->infile) {
+        curpos = vfs_ftell(info->infile);
         info->id3file = id3_file_vfsopen(info->infile, ID3_FILE_MODE_READONLY);
+    }
     else
         info->id3file = id3_file_open(info->filename, ID3_FILE_MODE_READONLY);
 
@@ -432,6 +435,10 @@
     info->title = xmms_get_titlestring(audmad_config.title_override == TRUE ?
         audmad_config.id3_format : xmms_get_gentitle_format(), title_input);
 
+    // for connection via proxy, we have to stop transfer once. I can't explain the reason.
+    vfs_fseek(info->infile, -1, SEEK_SET); // impossible request
+    vfs_fseek(info->infile, curpos, SEEK_SET);
+    
 #ifdef DEBUG
     g_message("e: input_read_tag");
 #endif