From 88c0ce06cba099b1ed53e4a89d59a4102e1c29f2 Mon Sep 17 00:00:00 2001 From: martii Date: Sun, 28 Jul 2013 14:40:30 +0200 Subject: [PATCH] libeplayer3/container_ass: cosmetics --- libeplayer3/container/container_ass.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/libeplayer3/container/container_ass.c b/libeplayer3/container/container_ass.c index d10a8cf..5f1a4c8 100644 --- a/libeplayer3/container/container_ass.c +++ b/libeplayer3/container/container_ass.c @@ -193,7 +193,7 @@ void releaseRegions() } next = firstRegion; - while (next != NULL) + while (next) { if (writer) { @@ -242,13 +242,13 @@ void checkRegions() writer = getDefaultFramebufferWriter(); - if (writer == NULL) + if (!writer) { ass_err("no framebuffer writer found!\n"); } prev = next = firstRegion; - while (next != NULL) + while (next) { if (now > next->undisplay + cDeltaTime) { @@ -384,7 +384,7 @@ static void ASSThread(Context_t *context) { ass_printf(150, "img %p pts %lu %f\n", img, playPts, playPts / 90.0); - if(img != NULL && ass_renderer && ass_track) + if(img && ass_renderer && ass_track) { /* the spec says, that if a new set of regions is present * the complete display switches to the new state. So lets @@ -397,7 +397,7 @@ static void ASSThread(Context_t *context) { time_t undisplay = now + 10; if (ass_track && ass_track->events) - undisplay = now + (ass_track->events->Duration + 500) / 90000; + undisplay = now + (ass_track->events->Duration + 500) / 90000; if (shareFramebuffer) { ASS_Image *it; @@ -455,7 +455,7 @@ static void ASSThread(Context_t *context) { /* api docu said w and h can be zero which * means image should not be rendered */ - if ((img->w != 0) && (img->h != 0) && (writer)) + if ((img->w != 0) && (img->h != 0) && writer) { out.fd = framebufferFD; out.data = img->bitmap; @@ -482,6 +482,8 @@ static void ASSThread(Context_t *context) { writer->writeData(&out); } } +#if NO_SHARED_FRAMEBUFFER +// currently not needed, but might be useful when switching to cst subtitle implementation in movieplayer else { /* application does not want to share framebuffer, @@ -512,6 +514,7 @@ static void ASSThread(Context_t *context) { context->output && context->output->subtitle) context->output->subtitle->Write(context, &sub_out); } +#endif needsBlit = 1; } @@ -519,11 +522,6 @@ static void ASSThread(Context_t *context) { img = img->next; } } - else - { - /* noop */ - } - releaseMutex(__LINE__); } else { @@ -707,8 +705,7 @@ static int container_ass_stop(Context_t *context __attribute__((unused))) { writer = getDefaultFramebufferWriter(); - if (writer != NULL) - { + if (writer) { writer->reset(); }