- I_OUTPUTPICTURES = 0;
-
- /* Initialize the output structure */
- p_vout->output.i_chroma = i_chroma;
- p_vout->output.pf_setpalette = NULL;
- p_vout->output.i_width = i_width;
- p_vout->output.i_height = i_height;
- p_vout->output.i_aspect = p_vout->output.i_width
- * VOUT_ASPECT_FACTOR / p_vout->output.i_height;
-
-
- /* Define the bitmasks */
- switch( i_chroma )
- {
- case VLC_FOURCC( 'R','V','1','5' ):
- p_vout->output.i_rmask = 0x001f;
- p_vout->output.i_gmask = 0x03e0;
- p_vout->output.i_bmask = 0x7c00;
- break;
-
- case VLC_FOURCC( 'R','V','1','6' ):
- p_vout->output.i_rmask = 0x001f;
- p_vout->output.i_gmask = 0x07e0;
- p_vout->output.i_bmask = 0xf800;
- break;
-
- case VLC_FOURCC( 'R','V','2','4' ):
- p_vout->output.i_rmask = 0xff0000;
- p_vout->output.i_gmask = 0x00ff00;
- p_vout->output.i_bmask = 0x0000ff;
- break;
-
- case VLC_FOURCC( 'R','V','3','2' ):
- p_vout->output.i_rmask = 0xff0000;
- p_vout->output.i_gmask = 0x00ff00;
- p_vout->output.i_bmask = 0x0000ff;
- break;
- }
-
- /* Try to initialize 1 direct buffer */
- p_pic = NULL;
-
- /* Find an empty picture slot */
- for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
- {
- if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
- {
- p_pic = p_vout->p_picture + i_index;
- break;
- }
+ const int width = config_GetInt(vd, "vout-snapshot-width");
+ const int height = config_GetInt(vd, "vout-snapshot-height");
+ if (width <= 0 || height <= 0) {
+ msg_Err(vd, "snapshot-width/height are invalid");
+ free(sys);
+ return VLC_EGENERIC;