From 6f32128f565a7160599e9dbb9bde6feac3147af6 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Fri, 06 Mar 2009 08:39:28 +0000 Subject: Detach context from processing queue --- diff --git a/src/spin.c b/src/spin.c index a879ae4..3a51031 100644 --- a/src/spin.c +++ b/src/spin.c @@ -199,7 +199,7 @@ spin_out(Econtext *self, gsize *size_to_play) if (spin->state == PLAY && spin->sound_pos >= spin_size) { spin->state = IN; - string_unref(&spin->text); + text_unref(&spin->text); spinning(self->queue, &self->out); GST_DEBUG("[%p] self->out->state=%d", self, self->out->state); @@ -273,7 +273,11 @@ process(void *data) spinning(context->queue, &context->process); next = context->process->state == PROCESS; if (!next) - context->state |= INPROCESS; + { + context->state &= ~INPROCESS; + GST_DEBUG("[%p] context->state=%d", context, + context->state); + } pthread_mutex_unlock(&context->lock); pthread_mutex_lock(&process_lock); diff --git a/src/text.h b/src/text.h index 1983a70..445875a 100644 --- a/src/text.h +++ b/src/text.h @@ -96,25 +96,25 @@ text_last(Text *self) inline gboolean text_eot(Text *str) { -return str->frame_len == 0; + return str->frame_len == 0; } inline void -string_unref(Text *str) +text_unref(Text *str) { -if (text_eot(str)) - return; + if (text_eot(str)) + return; -gpointer data = NULL; + gpointer data = NULL; -if (str->offset + str->frame_len >= str->len) - data = str->body - sizeof(Text); + if (str->offset + str->frame_len >= str->len) + data = str->body - sizeof(Text); -memset(str, 0, sizeof(Text)); + memset(str, 0, sizeof(Text)); -GST_DEBUG("[%p]", data); + GST_DEBUG("[%p]", data); -g_free(data); + g_free(data); } #endif -- cgit v0.9.1