]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mp3dec_filter.c
audiod: Fix a bug in try_to_close_slot() for default config.
[paraslash.git] / mp3dec_filter.c
index a6a628ec2ee939b4d9bb86b171d51d0ec843f8d6..73ce0e502c9181c1d289cae48a638a5965248eea 100644 (file)
@@ -198,7 +198,7 @@ next_buffer:
        iqs = btr_get_input_queue_size(btrn);
        if (need_bad_data_delay(pmd, iqs))
                return;
-       ret = btr_node_status(btrn, fn->min_iqs);
+       ret = btr_node_status(btrn, fn->min_iqs, BTR_NT_INTERNAL);
        if (ret < 0)
                goto err;
        if (ret == 0)
@@ -228,7 +228,7 @@ next_frame:
        pmd->channels = MAD_NCHANNELS(&pmd->frame.header);
        ret = mad_frame_decode(&pmd->frame, &pmd->stream);
        if (ret != 0) {
-               PARA_CRIT_LOG("frame decode: %d\n", ret);
+               PARA_INFO_LOG("frame decode: %s\n", mad_stream_errorstr(&pmd->stream));
                used = used_mad_buffer_bytes(&pmd->stream, len);
                ret = handle_decode_error(pmd, used);
                btr_consume(btrn, used);
@@ -257,9 +257,8 @@ next_frame:
        goto next_frame;
 err:
        assert(ret < 0);
-       mp3dec_close(fn);
        t->error = ret;
-       btr_del_node(btrn);
+       btr_remove_node(btrn);
 }
 
 static void mp3dec_open(struct filter_node *fn)
@@ -318,6 +317,11 @@ static int mp3dec_execute(struct btr_node *btrn, const char *cmd, char **result)
        }
        return -ERRNO_TO_PARA_ERROR(ENOTSUP);
 }
+
+static void mp3dec_free_config(void *conf)
+{
+       mp3dec_cmdline_parser_free(conf);
+}
 /**
  * The init function of the mp3dec filter.
  *
@@ -334,6 +338,7 @@ void mp3dec_filter_init(struct filter *f)
        f->convert = mp3dec;
        f->close = mp3dec_close;
        f->parse_config = mp3dec_parse_config;
+       f->free_config = mp3dec_free_config;
        f->pre_select = generic_filter_pre_select;
        f->post_select = mp3dec_post_select;
        f->execute = mp3dec_execute;