#endif
#include <vlc_vout.h>
-#include <vlc_playlist.h>
#include <vlc_filter.h>
#include <vlc_osd.h>
{
if( !p_fmt )
{
- /* Reattach video output to playlist before bailing out */
+ /* Reattach video output to the instance before bailing out */
if( p_vout )
{
spu_Attach( p_vout->p_spu, p_this, false );
/* Allocate descriptor */
p_vout = vlc_object_create( p_parent, VLC_OBJECT_VOUT );
if( p_vout == NULL )
- {
- msg_Err( p_parent, "out of memory" );
return NULL;
- }
/* Initialize pictures - translation tables and functions
* will be initialized later in InitThread */
p_vout->render_time = 10;
p_vout->c_fps_samples = 0;
p_vout->b_filter_change = 0;
- p_vout->pf_control = 0;
- p_vout->p_parent_intf = 0;
+ p_vout->pf_control = NULL;
+ p_vout->p_window = NULL;
p_vout->i_par_num = p_vout->i_par_den = 1;
/* Initialize locks */
if( vlc_thread_create( p_vout, "video output", RunThread,
VLC_THREAD_PRIORITY_OUTPUT, true ) )
{
- msg_Err( p_vout, "out of memory" );
module_Unneed( p_vout, p_vout->p_module );
vlc_object_release( p_vout );
return NULL;
p_vout->b_error = 1;
}
- /* Need to reinitialise the chroma plugin */
+ /* Need to reinitialise the chroma plugin. Since we might need
+ * resizing too and it's not sure that we already had it,
+ * recreate the chroma plugin chain from scratch. */
+ /* dionoea */
if( p_vout->p_chroma->p_module )
{
- if( p_vout->p_chroma->p_module->pf_deactivate )
- p_vout->p_chroma->p_module->pf_deactivate( VLC_OBJECT(p_vout->p_chroma) );
- p_vout->p_chroma->p_module->pf_activate( VLC_OBJECT(p_vout->p_chroma) );
+ filter_t *p_chroma = p_vout->p_chroma;
+ module_Unneed( p_chroma, p_chroma->p_module );
+ p_chroma->fmt_out.video = p_vout->fmt_out;
+ p_chroma->fmt_out.video.i_rmask = p_vout->output.i_rmask;
+ p_chroma->fmt_out.video.i_gmask = p_vout->output.i_gmask;
+ p_chroma->fmt_out.video.i_bmask = p_vout->output.i_bmask;
+ p_chroma->fmt_out.video.i_rrshift = p_vout->output.i_rrshift;
+ p_chroma->fmt_out.video.i_lrshift = p_vout->output.i_lrshift;
+ p_chroma->fmt_out.video.i_rgshift = p_vout->output.i_rgshift;
+ p_chroma->fmt_out.video.i_lgshift = p_vout->output.i_lgshift;
+ p_chroma->fmt_out.video.i_rbshift = p_vout->output.i_rbshift;
+ p_chroma->fmt_out.video.i_lbshift = p_vout->output.i_lbshift;
+ p_chroma->p_module = module_Need( p_chroma, "video filter2", NULL, 0 );
+ if( !p_chroma->p_module )
+ {
+ msg_Err( p_vout, "WOW THIS SUCKS BIG TIME!!!!!" );
+ }
}
}
if( !p_vout->b_direct )
{
module_Unneed( p_vout->p_chroma, p_vout->p_chroma->p_module );
+ vlc_object_detach( p_vout->p_chroma );
+ vlc_object_release( p_vout->p_chroma );
p_vout->p_chroma = NULL;
}
if( !p_vout->b_direct )
{
module_Unneed( p_vout->p_chroma, p_vout->p_chroma->p_module );
- p_vout->p_chroma->p_module = NULL;
+ vlc_object_detach( p_vout->p_chroma );
+ vlc_object_release( p_vout->p_chroma );
+ p_vout->p_chroma = NULL;
}
/* Destroy all remaining pictures */