]> git.sesse.net Git - vlc/blobdiff - src/audio_output/aout_internal.h
Moved AoutChangeFilterString out of aout_internal.h.
[vlc] / src / audio_output / aout_internal.h
index 7a36b3716057e136de1ce605c1d1122ce29bf6e1..0d9da2a5641e1540e5e992202e3399fc0173b003 100644 (file)
@@ -142,7 +142,7 @@ void aout_FifoSet( aout_instance_t *, aout_fifo_t *, mtime_t );
 void aout_FifoMoveDates( aout_instance_t *, aout_fifo_t *, mtime_t );
 void aout_FifoDestroy( aout_instance_t * p_aout, aout_fifo_t * p_fifo );
 void aout_FormatsPrint( aout_instance_t * p_aout, const char * psz_text, const audio_sample_format_t * p_format1, const audio_sample_format_t * p_format2 );
-
+bool aout_ChangeFilterString( vlc_object_t *, aout_instance_t *, const char *psz_variable, const char *psz_name, bool b_add );
 
 /* From intf.c :*/
 int aout_VolumeSoftGet( aout_instance_t *, audio_volume_t * );
@@ -266,69 +266,4 @@ static inline void AoutInputsMarkToRestart( aout_instance_t *p_aout )
     aout_unlock_mixer( p_aout );
 }
 
-/* This function will add or remove a a module from a string list (colon
- * separated). It will return true if there is a modification
- * In case p_aout is NULL, we will use configuration instead of variable */
-static inline bool AoutChangeFilterString( vlc_object_t *p_obj, aout_instance_t * p_aout,
-                                           const char* psz_variable,
-                                           const char *psz_name, bool b_add )
-{
-    char *psz_val;
-    char *psz_parser;
-
-    if( *psz_name == '\0' )
-        return false;
-
-    if( p_aout )
-        psz_val = var_GetString( p_aout, psz_variable );
-    else
-    {
-        psz_val = var_CreateGetString( p_obj->p_libvlc, "audio-filter" );
-        var_Destroy( p_obj->p_libvlc, "audio-filter" );
-    }
-
-    if( !psz_val )
-        psz_val = strdup( "" );
-
-    psz_parser = strstr( psz_val, psz_name );
-
-    if( ( b_add && psz_parser ) || ( !b_add && !psz_parser ) )
-    {
-        /* Nothing to do */
-        free( psz_val );
-        return false;
-    }
-
-    if( b_add )
-    {
-        char *psz_old = psz_val;
-        if( *psz_old )
-        {
-            if( asprintf( &psz_val, "%s:%s", psz_old, psz_name ) == -1 )
-                psz_val = NULL;
-        }
-        else
-            psz_val = strdup( psz_name );
-        free( psz_old );
-    }
-    else
-    {
-        const int i_name = strlen( psz_name );
-        const char *psz_next;
-
-        psz_next = &psz_parser[i_name];
-        if( *psz_next == ':' )
-            psz_next++;
-
-        memmove( psz_parser, psz_next, strlen(psz_next)+1 );
-    }
-
-    if( p_aout )
-        var_SetString( p_aout, psz_variable, psz_val );
-    else
-        config_PutPsz( p_obj, psz_variable, psz_val );
-    free( psz_val );
-    return true;
-}
-
 #endif /* !__LIBVLC_AOUT_INTERNAL_H */