summaryrefslogtreecommitdiffstats
path: root/apps/metadata/mp4.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/metadata/mp4.c')
-rw-r--r--apps/metadata/mp4.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/metadata/mp4.c b/apps/metadata/mp4.c
index 706e621234..14aad2203c 100644
--- a/apps/metadata/mp4.c
+++ b/apps/metadata/mp4.c
@@ -117,11 +117,17 @@ static unsigned int read_mp4_tag_string(int fd, int size_left, char** buffer,
if (bytes_read)
{
- (*buffer)[bytes_read] = 0;
- *dest = *buffer;
- length = strlen(*buffer) + 1;
- *buffer_left -= length;
- *buffer += length;
+ /* Do not overwrite already available metadata. Especially when reading
+ * tags with e.g. multiple genres / artists. This way only the first
+ * of multiple entries is used, all following are dropped. */
+ if (*dest == NULL)
+ {
+ (*buffer)[bytes_read] = 0;
+ *dest = *buffer;
+ length = strlen(*buffer) + 1;
+ *buffer_left -= length;
+ *buffer += length;
+ }
}
else
{