changeset 895:5d7e6f06c9b7 trunk

[svn] - now wma can handle wide characters in metadata. - wma no longer returns tuple with empty strings. (these should be NULL instead.)
author yaz
date Sat, 24 Mar 2007 09:29:41 -0700
parents f19e6748d8eb
children f0846bdd9de6
files ChangeLog src/wma/libffwma/asf.c src/wma/wma.c
diffstat 3 files changed, 76 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Mar 24 09:08:58 2007 -0700
+++ b/ChangeLog	Sat Mar 24 09:29:41 2007 -0700
@@ -1,3 +1,36 @@
+2007-03-24 16:08:58 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
+  revision [1888]
+  maintenance of build system:
+  - link for OBJECTIVE_LIBS had not occurred even if OBJECTIVE_LIBS_NOINST was re-linked. LIBDEP macro is introduced to indicate dependency.
+  - make rules such as $(AR) cq $@ $(OBJECTS) in individual Makefile have been removed. these linkage will be done through objective.mk.
+  - *.h has been removed from SOURCES. these files had been passed to linker as object files.
+  
+  trunk/mk/objective.mk                            |    6 +++---
+  trunk/src/aac/libfaad2/Makefile                  |    3 ---
+  trunk/src/aac/mp4ff/Makefile                     |    3 ---
+  trunk/src/aac/src/Makefile                       |    2 ++
+  trunk/src/adplug/Makefile                        |    2 ++
+  trunk/src/amidi-plug/Makefile                    |    2 ++
+  trunk/src/amidi-plug/backend-alsa/Makefile       |    2 ++
+  trunk/src/amidi-plug/backend-dummy/Makefile      |    2 ++
+  trunk/src/amidi-plug/backend-fluidsynth/Makefile |    2 ++
+  trunk/src/flac/Makefile                          |    2 ++
+  trunk/src/flac/libflac/Makefile                  |    3 ---
+  trunk/src/flac/plugin_common/Makefile            |    3 ---
+  trunk/src/modplug/Makefile                       |    2 ++
+  trunk/src/modplug/archive/Makefile               |    3 ---
+  trunk/src/modplug/gui/Makefile                   |    3 ---
+  trunk/src/paranormal/Makefile                    |    2 ++
+  trunk/src/paranormal/libcalc/Makefile            |    3 ---
+  trunk/src/rovascope/Makefile                     |    2 ++
+  trunk/src/rovascope/libcalc/Makefile             |    2 --
+  trunk/src/timidity/libtimidity/Makefile          |    4 ----
+  trunk/src/timidity/src/Makefile                  |    2 ++
+  trunk/src/wma/Makefile                           |    2 ++
+  trunk/src/wma/libffwma/Makefile                  |   15 +++++----------
+  23 files changed, 32 insertions(+), 40 deletions(-)
+
+
 2007-03-23 13:46:04 +0000  Giacomo Lozito <james@develia.org>
   revision [1886]
   - aosd: added an option to enable/disable utf8 text conversion done by the plugin
--- a/src/wma/libffwma/asf.c	Sat Mar 24 09:08:58 2007 -0700
+++ b/src/wma/libffwma/asf.c	Sat Mar 24 09:29:41 2007 -0700
@@ -306,17 +306,21 @@
 
 static void get_str16_nolen(ByteIOContext *pb, int len, char *buf, int buf_size)
 {
-    int c;
-    char *q;
+    gchar *ucs, *uptr;
+    gchar *tmp;
+    int tmplen = len;
+
+    ucs = g_malloc0(len);
+    uptr = ucs;
 
-    q = buf;
-    while (len > 0) {
-    	c = get_le16(pb);
-	if ((q - buf) < buf_size - 1)
-	*q++ = c;
-	len-=2;
-	}
-	   *q = '\0';
+    while(tmplen > 0) {
+        *uptr++ = (gchar)get_byte(pb);
+        tmplen--;
+    }
+
+    tmp = g_convert(ucs, len, "UTF-8", "UCS-2LE", NULL, NULL, NULL);
+    g_strlcpy(buf, tmp, buf_size);
+    g_free(tmp);
 }
 
 static int asf_probe(AVProbeData *pd)
--- a/src/wma/wma.c	Sat Mar 24 09:08:58 2007 -0700
+++ b/src/wma/wma.c	Sat Mar 24 09:29:41 2007 -0700
@@ -289,18 +289,20 @@
 	
     av_find_stream_info(in);
 
-    if((in->title[0] != '\0') || (in->author[0] != '\0') || (in->album[0] != '\0') ||
-       (in->comment[0] != '\0') || (in->genre[0] != '\0') || (in->year != 0) || (in->track != 0))
-    {	
-	tuple->performer = str_to_utf8(w_getstr(in->author));
-	tuple->album_name = str_to_utf8(w_getstr(in->album));
-	tuple->track_name = str_to_utf8(w_getstr(in->title));
-	tuple->year = in->year;
-	tuple->track_number = in->track;
-	tuple->genre = str_to_utf8(w_getstr(in->genre));
-	tuple->comment = str_to_utf8(w_getstr(in->comment));
-    }
-
+    if(strlen(in->title))
+        tuple->track_name = strdup(in->title);
+    if(strlen(in->author))
+        tuple->performer = strdup(in->author);
+    if(strlen(in->album))
+        tuple->album_name = strdup(in->album);
+    if(strlen(in->comment))
+        tuple->comment = strdup(in->comment);
+    if(strlen(in->genre))
+        tuple->genre = strdup(in->genre);
+    if(in->year > 0)
+       tuple->year = in->year;
+    if(in->track > 0)
+        tuple->track_number = in->track;
     if (in->duration)
         tuple->length = in->duration / 1000;
 
@@ -316,17 +318,21 @@
 
     input = bmp_title_input_new();
     
-    if((in->title[0] != '\0') || (in->author[0] != '\0') || (in->album[0] != '\0') ||
-       (in->comment[0] != '\0') || (in->genre[0] != '\0') || (in->year != 0) || (in->track != 0))
-    {	
-	input->performer = w_getstr(in->author);
-	input->album_name = w_getstr(in->album);
-	input->track_name = w_getstr(in->title);
-	input->year = in->year;
-	input->track_number = in->track;
-	input->genre = w_getstr(in->genre);
-	input->comment = w_getstr(in->comment);
-    }
+    if(strlen(in->title))
+        input->track_name = strdup(in->title);
+    if(strlen(in->author))
+        input->performer = strdup(in->author);
+    if(strlen(in->album))
+        input->album_name = strdup(in->album);
+    if(strlen(in->comment))
+        input->comment = strdup(in->comment);
+    if(strlen(in->genre))
+        input->genre = strdup(in->genre);
+    if(in->year > 0)
+       input->year = in->year;
+    if(in->track > 0)
+        input->track_number = in->track;
+
     input->file_name = g_path_get_basename(filename);
     input->file_path = g_path_get_dirname(filename);
     input->file_ext = extname(filename);