- /* It is either because:
- * - the picture is not a direct buffer
- * - we have to render subtitles (we can never do it on the given
- * picture even if not referenced).
- */
- picture_t *p_render;
- if( p_subpic != NULL && PP_OUTPUTPICTURE[0]->b_slow )
- {
- /* The picture buffer is in slow memory. We'll use
- * the "2 * VOUT_MAX_PICTURES + 1" picture as a temporary
- * one for subpictures rendering. */
- p_render = &p_vout->p_picture[2 * VOUT_MAX_PICTURES];
- if( p_render->i_status == FREE_PICTURE )
- {
- vout_AllocatePicture( VLC_OBJECT(p_vout),
- p_render, p_vout->fmt_out.i_chroma,
- p_vout->fmt_out.i_width,
- p_vout->fmt_out.i_height,
- p_vout->fmt_out.i_sar_num,
- p_vout->fmt_out.i_sar_den );
- p_render->i_type = MEMORY_PICTURE;
- p_render->i_status = RESERVED_PICTURE;
- }
- }
- else
- {
- /* We can directly render into a direct buffer */
- p_render = PP_OUTPUTPICTURE[0];
- }
-
- /* Copy */
- picture_Copy( p_render, p_pic );
-
- /* Render the subtitles if present */
- if( p_subpic )
- spu_RenderSubpictures( p_vout->p->p_spu,
- p_render, &p_vout->fmt_out,
- p_subpic, &p_vout->fmt_in, render_date );
- /* Copy in case we used a temporary fast buffer */
- if( p_render != PP_OUTPUTPICTURE[0] )
- picture_Copy( PP_OUTPUTPICTURE[0], p_render );
-
- return PP_OUTPUTPICTURE[0];