Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-03-06 08:39:28 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-03-06 08:39:28 (GMT)
commit6f32128f565a7160599e9dbb9bde6feac3147af6 (patch)
treeeff5601327f19898e38c06b2dd729faf86887f7b
parente33693d763d2aeb350b87ca6468cdd5515a8382d (diff)
Detach context from processing queue
-rw-r--r--src/spin.c8
-rw-r--r--src/text.h20
2 files changed, 16 insertions, 12 deletions
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