summaryrefslogtreecommitdiff
path: root/plugins/mpgmad
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-05-08 21:14:30 +0200
committerGravatar waker <wakeroid@gmail.com>2011-05-08 21:14:30 +0200
commit3ec7a3d62a7383f19d4d4ee68ea9f0c66c9fe970 (patch)
treee7f95127ad480f446c10c81ffe220e581622e8e2 /plugins/mpgmad
parentb5ffaa4ae71ce0520d55b99e0501b92c031e860e (diff)
changed few old-style pl_* functions which were working with current playlist with the new ones, working with specific playlist passed as argument
Diffstat (limited to 'plugins/mpgmad')
-rw-r--r--plugins/mpgmad/mpgmad.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c
index 3b7c23b5..adda106c 100644
--- a/plugins/mpgmad/mpgmad.c
+++ b/plugins/mpgmad/mpgmad.c
@@ -823,7 +823,11 @@ cmp3_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
trace ("mp3 totalsamples: %d\n", info->buffer.endsample-info->buffer.startsample+1);
}
else {
- deadbeef->pl_set_item_duration (it, info->buffer.duration);
+ ddb_playlist_t *plt = deadbeef->pl_get_playlist (it);
+ deadbeef->plt_set_item_duration (plt, it, info->buffer.duration);
+ if (plt) {
+ deadbeef->plt_unref (plt);
+ }
info->buffer.startsample = info->buffer.delay;
info->buffer.endsample = info->buffer.totalsamples-info->buffer.padding-1;
trace ("mp3 totalsamples: %d (%d, %d, %d | %d %d)\n", info->buffer.endsample-info->buffer.startsample+1, info->buffer.totalsamples, info->buffer.delay, info->buffer.padding, info->buffer.startsample, info->buffer.endsample);
@@ -854,7 +858,11 @@ cmp3_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
cmp3_set_extra_properties (&info->buffer);
- deadbeef->pl_set_item_duration (it, info->buffer.duration);
+ ddb_playlist_t *plt = deadbeef->pl_get_playlist (it);
+ deadbeef->plt_set_item_duration (plt, it, info->buffer.duration);
+ if (plt) {
+ deadbeef->plt_unref (plt);
+ }
if (info->buffer.duration >= 0) {
info->buffer.endsample = info->buffer.totalsamples - 1;
}
@@ -1310,7 +1318,7 @@ cmp3_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) {
DB_playItem_t *it = deadbeef->pl_item_alloc_init (fname, plugin.plugin.id);
deadbeef->fclose (fp);
deadbeef->pl_add_meta (it, "title", NULL);
- deadbeef->pl_set_item_duration (it, -1);
+ deadbeef->plt_set_item_duration (plt, it, -1);
after = deadbeef->plt_insert_item (plt, after, it);
deadbeef->pl_item_unref (it);
return after;