summaryrefslogtreecommitdiff
path: root/plugins/vorbis
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-23 17:49:50 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-23 17:49:50 +0100
commitcf2e88409ceecc1dfda1eafb66284492aec468c1 (patch)
tree891443e041403eca88059ea1b1f6f231ff354e5a /plugins/vorbis
parentd1fd877d83c895bc399682e23f123c94233c42fc (diff)
use refcounting in vorbis plugin
Diffstat (limited to 'plugins/vorbis')
-rw-r--r--plugins/vorbis/vorbis.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c
index 6a69b57b..b2b4e42c 100644
--- a/plugins/vorbis/vorbis.c
+++ b/plugins/vorbis/vorbis.c
@@ -44,7 +44,7 @@ typedef struct {
int endsample;
int currentsample;
int last_comment_update;
- DB_playItem_t *ptrack; // FIXME: addref that
+ DB_playItem_t *ptrack;
} ogg_info_t;
static size_t
@@ -130,8 +130,7 @@ cvorbis_init (DB_playItem_t *it) {
info->vi = NULL;
info->cur_bit_stream = -1;
info->ptrack = it;
- // FIXME: add reference to that one
- // deadbeef->pl_item_ref (it);
+ deadbeef->pl_item_ref (it);
info->file = deadbeef->fopen (it->fname);
if (!info->file) {
@@ -218,11 +217,9 @@ cvorbis_free (DB_fileinfo_t *_info) {
ogg_info_t *info = (ogg_info_t *)_info;
if (info) {
if (info->file) {
- info->ptrack = NULL;
- // FIXME: unref that
- // if (info->ptrack) {
- // deadbeef->pl_item_unref (info->ptrack);
- // }
+ if (info->ptrack) {
+ deadbeef->pl_item_unref (info->ptrack);
+ }
ov_clear (&info->vorbis_file);
//fclose (file); //-- ov_clear closes it
}