 +    int frame_height = this->decoder->master->cached_height;
 +
 +    /* Create a full-window OSD */
-+    if( this->osd )
++    if( this->osd ) {
 +      this->osd_renderer->free_object (this->osd);
++    }
 +
 +    this->osd = this->osd_renderer->new_object (this->osd_renderer, frame_width, frame_height);
 +

+#endif
+
+  /* if the motion hasn't started yet, or is over, same */
+  if (pts<item->start_pts || pts>item->end_pts) return;
+
+  // TODO: we might not need to redraw every time ?
+  // TODO: if only region position changes, might be enough to set_pos the osd
+  xinekate_draw_item(item);
+
+#ifdef FORCE_SHOWING
+  if (1)
+#else
+  if (item->last_animation_frame_pts<0)
+#endif
+  {
+    //if (!item->animated) lprintf("Showing now non animated OSD, text %s\n",item->ev_text);
+    if (item->osd_renderer)
+      item->osd_renderer->show(item->osd, 0);
+  }
+}
+

+  "tiny", "small", "normal", "large", "very large", "huge", NULL
+};
+
+/* found in the SPU decoder */
+#define rgb2yuv(R,G,B) \
+  ((((((66*R+129*G+25*B+128)>>8)+16)<<8)|(((112*R-94*G-18*B+128)>>8)+128))<<8|(((-38*R-74*G+112*B+128)>>8)+128))
+
+/* colors 224 to 255 are for background/marker colors */
+#define FIRST_BACKGROUND_PALETTE 224
