diff options
-rw-r--r-- | src/spin.c | 8 | ||||
-rw-r--r-- | src/text.h | 20 |
2 files changed, 16 insertions, 12 deletions
@@ -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); @@ -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 |