From 92debcdb77488c3350324c7ebd765aa250d55287 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Fri, 7 Aug 2009 22:49:11 +0200 Subject: add vorbis file name if no vorbis comment found --- cvorbis.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cvorbis.c') 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; -- cgit v1.2.3