diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-10-27 19:20:44 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-10-27 19:20:44 +0100 |
commit | 90eb1072b0a9d4ab16beebf4bb5d547a9f2d776d (patch) | |
tree | e1adef47fd2c1647b3931c495d5a6d30c46b0b16 /plugins/m3u | |
parent | 958259c60911e18e48b3be1739d65ae47154a631 (diff) |
m3u: fixed duration bug
Diffstat (limited to 'plugins/m3u')
-rw-r--r-- | plugins/m3u/m3u.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/m3u/m3u.c b/plugins/m3u/m3u.c index 7f5a28fa..1556aeb9 100644 --- a/plugins/m3u/m3u.c +++ b/plugins/m3u/m3u.c @@ -189,7 +189,7 @@ load_m3u (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pab trace ("pl_insert_m3u: adding file %s\n", nm); it = deadbeef->plt_insert_file (plt, after, nm, pabort, cb, user_data); if (it) { - if (length >= 0) { + if (length >= 0 && deadbeef->pl_get_item_duration (it) < 0) { deadbeef->plt_set_item_duration (plt, it, length); } if (title[0]) { @@ -497,7 +497,7 @@ m3uplug_save_m3u (const char *fname, DB_playItem_t *first, DB_playItem_t *last) it = next; continue; } - int dur = (int)ceil(deadbeef->pl_get_item_duration (it)); + int dur = (int)floor(deadbeef->pl_get_item_duration (it)); char s[1000]; if (deadbeef->pl_meta_exists (it, "artist")) { deadbeef->pl_format_title (it, -1, s, sizeof (s), -1, "%a - %t"); |