p_sys->ppsz_order = NULL;
psz_order = var_CreateGetString( p_filter->p_libvlc, "mosaic-order" );
- fprintf( stderr, "psz_order : %s (%p)\n", psz_order, psz_order );
if( psz_order[0] != 0 )
{
i_index = 0;
p_sys->i_order_length = i_index;
}
- for( i_index = 0; i_index < p_sys->i_order_length; i_index ++ )
- {
- fprintf( stderr, "%d/%d : %s\n", i_index, p_sys->i_order_length, p_sys->ppsz_order[i_index] );
- }
-
var_AddCallback( p_filter->p_libvlc, "mosaic-alpha",
MosaicCallback, p_sys );
var_AddCallback( p_filter->p_libvlc, "mosaic-height",
{
filter_t *p_filter = (filter_t*)p_this;
filter_sys_t *p_sys = p_filter->p_sys;
+ int i_index;
image_HandlerDelete( p_sys->p_image );
image_HandlerDelete( p_sys->p_image2 );
+ if( p_sys->i_order_length )
+ {
+ for( i_index = 0; i_index < p_sys->i_order_length; i_index++ )
+ {
+ free( p_sys->ppsz_order[i_index] );
+ }
+ free( p_sys->ppsz_order );
+ }
+
var_Destroy( p_filter->p_libvlc, "mosaic-alpha" );
var_Destroy( p_filter->p_libvlc, "mosaic-height" );
var_Destroy( p_filter->p_libvlc, "mosaic-width" );
if( p_sys->i_pos == 0 ) /* use automatic positioning */
{
- int i_numpics = 0;
+ int i_numpics = p_sys->i_order_length; /* keep slots and all */
for( i_index = 0 ;
i_index < p_picture_vout->i_picture_num ;
i_index ++ )
if( p_picture_vout->p_pic[i_index].i_status
== PICTURE_VOUT_E_OCCUPIED ) {
i_numpics ++;
+ if( p_sys->i_order_length
+ && p_picture_vout->p_pic[i_index].psz_id != 0 ){
+ /* we also want to leave slots for images given in mosaic-order
+ that are not available in p_vout_picture */
+ int i;
+ for( i = 0; i < p_sys->i_order_length ; i++ )
+ {
+ if( ! strcmp( p_sys->ppsz_order[i],
+ p_picture_vout->p_pic[i_index].psz_id ) )
+ {
+ i_numpics --;
+ break;
+ }
+ }
+
+ }
}
}
p_sys->i_rows = ((int)ceil(sqrt( (float)i_numpics )));
i_row = ( i_real_index / p_sys->i_cols ) % p_sys->i_rows ;
i_col = i_real_index % p_sys->i_cols ;
-
-
/* Convert the images */
/* fprintf (stderr, "Input image %ix%i %4.4s\n",
p_picture_vout->p_pic[i_index].p_picture->format.i_width,
void *p_data )
{
filter_sys_t *p_sys = (filter_sys_t *) p_data;
- fprintf( stderr, "Callback" );
if( !strcmp( psz_var, "mosaic-alpha" ) )
{
msg_Dbg( p_this, "Changing alpha from %d/255 to %d/255",