Пример #1
0
static int purge_sink(struct GrooveSink *sink) {
    struct GrooveSinkPrivate *s = (struct GrooveSinkPrivate *) sink;

    groove_queue_purge(s->audioq);

    struct GroovePlaylist *playlist = sink->playlist;
    struct GroovePlaylistPrivate *p = (struct GroovePlaylistPrivate *) playlist;
    struct GroovePlaylistItem *item = p->purge_item;

    if (sink->purge)
        sink->purge(sink, item);

    return 0;
}
Пример #2
0
static void sink_purge(struct GrooveSink *sink, struct GroovePlaylistItem *item) {
    struct GrooveFingerprinterPrivate *p = (GrooveFingerprinterPrivate *)sink->userdata;

    pthread_mutex_lock(&p->info_head_mutex);
    p->purge_item = item;
    groove_queue_purge(p->info_queue);
    p->purge_item = NULL;

    if (p->info_head == item) {
        p->info_head = NULL;
        p->info_pos = -1.0;
    }
    pthread_cond_signal(&p->drain_cond);
    pthread_mutex_unlock(&p->info_head_mutex);
}
Пример #3
0
static void sink_purge(struct GrooveSink *sink, struct GroovePlaylistItem *item) {
    struct GrooveEncoder *encoder = sink->userdata;
    struct GrooveEncoderPrivate *e = (struct GrooveEncoderPrivate *) encoder;

    pthread_mutex_lock(&e->encode_head_mutex);
    e->purge_item = item;
    groove_queue_purge(e->audioq);
    e->purge_item = NULL;

    if (e->encode_head == item) {
        e->encode_head = NULL;
        e->encode_pos = -1.0;
    }
    pthread_cond_signal(&e->drain_cond);
    pthread_mutex_unlock(&e->encode_head_mutex);
}