summaryrefslogtreecommitdiff
path: root/cvorbis.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-08-07 22:49:11 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-08-07 22:49:11 +0200
commit92debcdb77488c3350324c7ebd765aa250d55287 (patch)
treebdaa8188851bb9f9faf53a0c055f4787e0112586 /cvorbis.c
parent8a3ba0253ad9b38510447263d2b81378dcd0465e (diff)
add vorbis file name if no vorbis comment found
Diffstat (limited to 'cvorbis.c')
-rw-r--r--cvorbis.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cvorbis.c b/cvorbis.c
index 2d801113..563de6f5 100644
--- a/cvorbis.c
+++ b/cvorbis.c
@@ -120,6 +120,7 @@ cvorbis_insert (playItem_t *after, const char *fname) {
it->timeend = 0;
// metainfo
+ int title_added = 0;
vorbis_comment *vc = ov_comment (&vorbis_file, -1);
if (vc) {
ps_add_meta (it, "vendor", vc->vendor);
@@ -129,12 +130,16 @@ cvorbis_insert (playItem_t *after, const char *fname) {
}
else if (!strncmp (vc->user_comments[i], "title=", 6)) {
ps_add_meta (it, "title", vc->user_comments[i] + 6);
+ title_added = 1;
}
else if (!strncmp (vc->user_comments[i], "date=", 5)) {
ps_add_meta (it, "date", vc->user_comments[i] + 5);
}
}
}
+ if (!title_added) {
+ ps_add_meta (it, "title", NULL);
+ }
ov_clear (&vorbis_file);
after = ps_insert_item (after, it);
return after;