Revision: 294
http://svn.sourceforge.net/pmplib/?rev=294&view=rev
Author: nyaochi
Date: 2007-01-28 14:46:02 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Moved back to the old code; let libid3tag to manage the file pointer opened for id3_file_fdopen().
I got a bug report from a user who seems to utilize a non-native UNICODE path/file name on Win32.
Modified Paths:
--------------
trunk/pmplib/lib/gmi/gmi_mp3.c
Modified: trunk/pmplib/lib/gmi/gmi_mp3.c
===================================================================
--- trunk/pmplib/lib/gmi/gmi_mp3.c 2007-01-28 22:30:55 UTC (rev 293)
+++ trunk/pmplib/lib/gmi/gmi_mp3.c 2007-01-28 22:46:02 UTC (rev 294)
@@ -333,12 +333,18 @@
ucs2char_t* ucs2 = NULL;
struct id3_file *id3file = NULL;
struct id3_tag *id3tag = NULL;
- char* pathname = ucs2dupmbs(filename);
+ FILE *fp = NULL;
+ /* Open the file with UNICODE filename. This is for better compatibility. */
+ fp = ucs2fopen(filename, "rb");
+ if (!fp) {
+ return -1;
+ }
+
/* Open with libid3tag */
- id3file = id3_file_open(pathname, ID3_FILE_MODE_READONLY);
- ucs2free(pathname);
+ id3file = id3_file_fdopen(fileno(fp), ID3_FILE_MODE_READONLY);
if (!id3file) {
+ fclose(fp);
return -1;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|