mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libeplayer3/container_ass: cosmetics
This commit is contained in:
@@ -193,7 +193,7 @@ void releaseRegions()
|
|||||||
}
|
}
|
||||||
|
|
||||||
next = firstRegion;
|
next = firstRegion;
|
||||||
while (next != NULL)
|
while (next)
|
||||||
{
|
{
|
||||||
if (writer)
|
if (writer)
|
||||||
{
|
{
|
||||||
@@ -242,13 +242,13 @@ void checkRegions()
|
|||||||
|
|
||||||
writer = getDefaultFramebufferWriter();
|
writer = getDefaultFramebufferWriter();
|
||||||
|
|
||||||
if (writer == NULL)
|
if (!writer)
|
||||||
{
|
{
|
||||||
ass_err("no framebuffer writer found!\n");
|
ass_err("no framebuffer writer found!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = next = firstRegion;
|
prev = next = firstRegion;
|
||||||
while (next != NULL)
|
while (next)
|
||||||
{
|
{
|
||||||
if (now > next->undisplay + cDeltaTime)
|
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);
|
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 spec says, that if a new set of regions is present
|
||||||
* the complete display switches to the new state. So lets
|
* 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;
|
time_t undisplay = now + 10;
|
||||||
|
|
||||||
if (ass_track && ass_track->events)
|
if (ass_track && ass_track->events)
|
||||||
undisplay = now + (ass_track->events->Duration + 500) / 90000;
|
undisplay = now + (ass_track->events->Duration + 500) / 90000;
|
||||||
|
|
||||||
if (shareFramebuffer) {
|
if (shareFramebuffer) {
|
||||||
ASS_Image *it;
|
ASS_Image *it;
|
||||||
@@ -455,7 +455,7 @@ static void ASSThread(Context_t *context) {
|
|||||||
/* api docu said w and h can be zero which
|
/* api docu said w and h can be zero which
|
||||||
* means image should not be rendered
|
* 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.fd = framebufferFD;
|
||||||
out.data = img->bitmap;
|
out.data = img->bitmap;
|
||||||
@@ -482,6 +482,8 @@ static void ASSThread(Context_t *context) {
|
|||||||
writer->writeData(&out);
|
writer->writeData(&out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if NO_SHARED_FRAMEBUFFER
|
||||||
|
// currently not needed, but might be useful when switching to cst subtitle implementation in movieplayer
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* application does not want to share framebuffer,
|
/* application does not want to share framebuffer,
|
||||||
@@ -512,6 +514,7 @@ static void ASSThread(Context_t *context) {
|
|||||||
context->output && context->output->subtitle)
|
context->output && context->output->subtitle)
|
||||||
context->output->subtitle->Write(context, &sub_out);
|
context->output->subtitle->Write(context, &sub_out);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
needsBlit = 1;
|
needsBlit = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,11 +522,6 @@ static void ASSThread(Context_t *context) {
|
|||||||
img = img->next;
|
img = img->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* noop */
|
|
||||||
}
|
|
||||||
|
|
||||||
releaseMutex(__LINE__);
|
releaseMutex(__LINE__);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
@@ -707,8 +705,7 @@ static int container_ass_stop(Context_t *context __attribute__((unused))) {
|
|||||||
|
|
||||||
writer = getDefaultFramebufferWriter();
|
writer = getDefaultFramebufferWriter();
|
||||||
|
|
||||||
if (writer != NULL)
|
if (writer) {
|
||||||
{
|
|
||||||
writer->reset();
|
writer->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user