Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforge.net>2009-03-25 10:41:12 +0300
committerJustin Maggard <jmaggard@users.sourceforge.net>2009-03-25 10:41:12 +0300
commitfc7d4de433e5faf2791355eb639ced8f35c7bcac (patch)
treef20579e8fcc8882c8b8252a61421a13666211ed0 /tagutils
parentc70b6ced8683799d8aa5a5975ffccdb9af1969fb (diff)
* Put WMA artist tag info where the metadata parser expects it to be.
Diffstat (limited to 'tagutils')
-rw-r--r--tagutils/tagutils-asf.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/tagutils/tagutils-asf.c b/tagutils/tagutils-asf.c
index 5ec2896..83a3fe1 100644
--- a/tagutils/tagutils-asf.c
+++ b/tagutils/tagutils-asf.c
@@ -293,7 +293,7 @@ _asf_load_string(FILE *fp, int type, int size, char *buf, int len)
return i;
}
-static void
+static void *
_asf_load_picture(FILE *fp, int size, void *bm, int *bm_size)
{
int i;
@@ -309,10 +309,21 @@ _asf_load_picture(FILE *fp, int size, void *bm, int *bm_size)
// Picture data <binary data>
pic_type = fget_byte(fp); size -= 1;
- pic_size = fget_le32(fp); size -= 2;
+ pic_size = fget_le32(fp); size -= 4;
+
+ for(i = 0; i < sizeof(buf) - 1; i++)
+ {
+ buf[i] = fget_le16(fp); size -= 2;
+ if(!buf[i])
+ break;
+ }
+ buf[i] = '\0';
+ if(i == sizeof(buf) - 1)
+ {
+ while(fget_le16(fp))
+ size -= 2;
+ }
- i = 0;
- buf[i] = 0;
if(!strcasecmp(buf, "image/jpeg") ||
!strcasecmp(buf, "image/jpg") ||
!strcasecmp(buf, "image/peg"))
@@ -355,6 +366,7 @@ _asf_load_picture(FILE *fp, int size, void *bm, int *bm_size)
}
*bm_size = size;
+ return bm;
}
static int
@@ -470,7 +482,7 @@ _get_asffileinfo(char *file, struct song_metadata *psong)
if(_asf_load_string(fp, ValueType, ValueLength, buf, sizeof(buf)))
{
if(buf[0])
- psong->contributor[ROLE_ALBUMARTIST] = strdup(buf);
+ psong->contributor[ROLE_ARTIST] = strdup(buf);
}
}
else if(!strcasecmp(buf, "Description") || !strcasecmp(buf, "WM/Track"))
@@ -499,7 +511,7 @@ _get_asffileinfo(char *file, struct song_metadata *psong)
}
else if(!strcasecmp(buf, "WM/Picture") && (ValueType == ASF_VT_BYTEARRAY))
{
- _asf_load_picture(fp, ValueLength, psong->image, &psong->image_size);
+ psong->image = _asf_load_picture(fp, ValueLength, psong->image, &psong->image_size);
}
else if(!strcasecmp(buf, "TrackNumber") || !strcasecmp(buf, "WM/TrackNumber"))
{