summaryrefslogtreecommitdiff
path: root/plugins/mpgmad/mpgmad.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-03-24 21:30:11 +0100
committerGravatar waker <wakeroid@gmail.com>2011-03-24 21:30:11 +0100
commitfd04c7a395f4ac26942222e29e2dd9a8901bff41 (patch)
tree0ed33d33f0171603c7f6503b52f5512770e59fcd /plugins/mpgmad/mpgmad.c
parent2278425be18b7600c055e54e5777b44858e1af4e (diff)
got rid of filetype field in playitem structure
Diffstat (limited to 'plugins/mpgmad/mpgmad.c')
-rw-r--r--plugins/mpgmad/mpgmad.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c
index dd6be528..29ea88b9 100644
--- a/plugins/mpgmad/mpgmad.c
+++ b/plugins/mpgmad/mpgmad.c
@@ -737,7 +737,7 @@ cmp3_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
}
else {
deadbeef->fset_track (info->buffer.file, it);
- info->buffer.it->filetype = NULL;
+ deadbeef->pl_delete_meta (info->buffer.it, ":FILETYPE");
int64_t len = deadbeef->fgetlength (info->buffer.file);
if (len > 0) {
deadbeef->pl_delete_all_meta (it);
@@ -1008,10 +1008,11 @@ cmp3_stream_frame (mpgmad_info_t *info) {
}
}
- if (!info->buffer.it->filetype) {
+ const char *filetype = deadbeef->pl_find_meta (info->buffer.it, ":FILETYPE");
+ if (!filetype) {
int layer = info->frame.header.layer;
if (layer >= 1 && layer <= 3) {
- info->buffer.it->filetype = plugin.filetypes[layer-1];
+ deadbeef->pl_replace_meta (info->buffer.it, ":FILETYPE", plugin.filetypes[layer-1]);
}
}
@@ -1254,7 +1255,6 @@ cmp3_insert (DB_playItem_t *after, const char *fname) {
deadbeef->fclose (fp);
deadbeef->pl_add_meta (it, "title", NULL);
deadbeef->pl_set_item_duration (it, -1);
- it->filetype = NULL;
after = deadbeef->pl_insert_item (after, it);
deadbeef->pl_item_unref (it);
return after;
@@ -1331,7 +1331,7 @@ cmp3_insert (DB_playItem_t *after, const char *fname) {
cmp3_set_extra_properties (&buffer);
deadbeef->pl_set_item_duration (it, buffer.duration);
- it->filetype = ftype;
+ deadbeef->pl_replace_meta (it, ":FILETYPE", ftype);
deadbeef->fclose (fp);
// FIXME! bad numsamples passed to cue