]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - prebuffer_filter.c
aac_afh: Fix check of return value of mp4ff_meta_update().
[paraslash.git] / prebuffer_filter.c
index 8ca1630d8112242ee65b3feb63e2883ffdac7f86..9a801900c157e1da2da979c92d7bd60d03e21b9c 100644 (file)
@@ -1,8 +1,4 @@
-/*
- * Copyright (C) 2009 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2009 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
 
 /** \file prebuffer_filter.c Paraslash's prebuffering filter. */
 
@@ -61,7 +57,14 @@ static int prebuffer_post_select(__a_unused struct sched *s, void *context)
        size_t iqs = btr_get_input_queue_size(btrn);
        struct private_prebuffer_data *ppd = fn->private_data;
        uint32_t size = FILTER_CMD_OPT_UINT32_VAL(PREBUFFER, SIZE, fn->lpr);
+       int ret;
 
+       ret = task_get_notification(fn->task);
+       if (ret < 0)
+               goto fail;
+       ret = btr_node_status(btrn, size, BTR_NT_INTERNAL);
+       if (ret < 0)
+               goto fail;
        if (ppd->barrier.tv_sec == 0)
                return 0;
        if (tv_diff(now, &ppd->barrier, NULL) < 0)
@@ -70,6 +73,9 @@ static int prebuffer_post_select(__a_unused struct sched *s, void *context)
                return 0;
        btr_splice_out_node(&fn->btrn);
        return -E_PREBUFFER_SUCCESS;
+fail:
+       btr_remove_node(&fn->btrn);
+       return ret;
 }
 
 static void prebuffer_open(struct filter_node *fn)