-/*****************************************************************************
- * SpuClearChannel: clear an spu channel
- *****************************************************************************
- * This function destroys the subpictures which belong to the spu channel
- * corresponding to i_channel_id.
- *****************************************************************************/
-static void SpuClearChannel( spu_t *p_spu, int i_channel )
-{
- spu_private_t *p_sys = p_spu->p;
- int i_subpic; /* subpicture index */
-
- vlc_mutex_lock( &p_sys->lock );
-
- for( i_subpic = 0; i_subpic < VOUT_MAX_SUBPICTURES; i_subpic++ )
- {
- spu_heap_entry_t *p_entry = &p_sys->heap.p_entry[i_subpic];
- subpicture_t *p_subpic = p_entry->p_subpicture;
-
- if( !p_subpic )
- continue;
- if( p_subpic->i_channel != i_channel && ( i_channel != -1 || p_subpic->i_channel == DEFAULT_CHAN ) )
- continue;
-
- /* You cannot delete subpicture outside of spu_SortSubpictures */
- p_entry->b_reject = true;
- }
-
- vlc_mutex_unlock( &p_sys->lock );
-}
-
-/*****************************************************************************
- * spu_ControlDefault: default methods for the subpicture unit control.
- *****************************************************************************/
-static int SpuControl( spu_t *p_spu, int i_query, va_list args )
-{
- spu_private_t *p_sys = p_spu->p;
- int *pi, i;
-
- switch( i_query )
- {
- case SPU_CHANNEL_REGISTER:
- pi = (int *)va_arg( args, int * );
- vlc_mutex_lock( &p_sys->lock );
- if( pi )
- *pi = p_sys->i_channel++;
- vlc_mutex_unlock( &p_sys->lock );
- break;
-
- case SPU_CHANNEL_CLEAR:
- i = (int)va_arg( args, int );
- SpuClearChannel( p_spu, i );
- break;
-
- default:
- msg_Dbg( p_spu, "control query not supported" );
- return VLC_EGENERIC;
- }
-
- return VLC_SUCCESS;
-}
-