#undef p_pic
/* We are about to die. Reattach video output to p_vlc. */
- vout_Request( p_dec, p_dec->p_owner->p_vout, 0, 0, 0, 0 );
+ vout_Request( p_dec, p_dec->p_owner->p_vout, 0 );
}
if( p_dec->p_owner->p_sout_input )
return NULL;
}
+ if( !p_dec->fmt_out.video.i_sar_num ||
+ !p_dec->fmt_out.video.i_sar_den )
+ {
+ p_dec->fmt_out.video.i_sar_num =
+ p_dec->fmt_out.video.i_aspect * p_dec->fmt_out.video.i_height;
+
+ p_dec->fmt_out.video.i_sar_den = VOUT_ASPECT_FACTOR *
+ p_dec->fmt_out.video.i_width;
+ }
+
+ vlc_reduce( &p_dec->fmt_out.video.i_sar_num,
+ &p_dec->fmt_out.video.i_sar_den,
+ p_dec->fmt_out.video.i_sar_num,
+ p_dec->fmt_out.video.i_sar_den, 0 );
+
+ if( !p_dec->fmt_out.video.i_visible_width ||
+ !p_dec->fmt_out.video.i_visible_height )
+ {
+ p_dec->fmt_out.video.i_visible_width =
+ p_dec->fmt_out.video.i_width;
+ p_dec->fmt_out.video.i_visible_height =
+ p_dec->fmt_out.video.i_height;
+ }
+
p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
p_sys->video = p_dec->fmt_out.video;
p_sys->p_vout = vout_Request( p_dec, p_sys->p_vout,
- p_sys->video.i_width,
- p_sys->video.i_height,
- p_sys->video.i_chroma,
- p_sys->video.i_aspect );
-
+ &p_dec->fmt_out.video );
if( p_sys->p_vout == NULL )
{
msg_Err( p_dec, "failed to create video output" );
static void spu_del_buffer( decoder_t *p_dec, subpicture_t *p_subpic )
{
- spu_DestroySubpicture( p_dec->p_owner->p_vout->p_spu, p_subpic );
+ decoder_owner_sys_t *p_sys = (decoder_owner_sys_t *)p_dec->p_owner;
+ vout_thread_t *p_vout = NULL;
+
+ p_vout = vlc_object_find( p_dec, VLC_OBJECT_VOUT, FIND_ANYWHERE );
+ if( !p_vout || p_sys->p_spu_vout != p_vout )
+ {
+ if( p_vout )
+ vlc_object_release( p_vout );
+ msg_Warn( p_dec, "no vout found, leaking subpicture" );
+ return;
+ }
+
+ spu_DestroySubpicture( p_vout->p_spu, p_subpic );
+
+ vlc_object_release( p_vout );
}
+