]> git.sesse.net Git - vlc/blobdiff - src/audio_output/input.c
Allow scaletempo to be toggled without restarting VLC
[vlc] / src / audio_output / input.c
index 8e4075624b02cd3748daea934eef426c0d815dfb..d041d68f6cda4653648f5f463296dcf44dfb0fe0 100644 (file)
@@ -223,15 +223,10 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_
         var_Create( p_aout, "audio-replay-gain-peak-protection",
                     VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
     }
-    if( var_Type( p_aout, "audio-time-stretch" ) == 0 )
-    {
-        var_Create( p_aout, "audio-time-stretch",
-                    VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
-    }
 
     psz_filters = var_GetString( p_aout, "audio-filter" );
     psz_visual = var_GetString( p_aout, "audio-visual");
-    psz_scaletempo = var_GetBool( p_aout, "audio-time-stretch" ) ? strdup( "scaletempo" ) : NULL;
+    psz_scaletempo = var_InheritBool( p_aout, "audio-time-stretch" ) ? strdup( "scaletempo" ) : NULL;
 
     p_input->b_recycle_vout = psz_visual && *psz_visual;
 
@@ -343,7 +338,6 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_
                          psz_parser );
 
                 free( p_filter->p_owner );
-                vlc_object_detach( p_filter );
                 vlc_object_release( p_filter );
 
                 psz_parser = psz_next;
@@ -364,7 +358,6 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_
 
                     module_unneed( p_filter, p_filter->p_module );
                     free( p_filter->p_owner );
-                    vlc_object_detach( p_filter );
                     vlc_object_release( p_filter );
 
                     psz_parser = psz_next;
@@ -817,7 +810,14 @@ static vout_thread_t *RequestVout( void *p_private,
 {
     aout_instance_t *p_aout = p_private;
     VLC_UNUSED(b_recycle);
-    return vout_Request( p_aout, p_vout, p_fmt );
+    vout_configuration_t cfg = {
+        .vout       = p_vout,
+        .input      = NULL,
+        .change_fmt = true,
+        .fmt        = p_fmt,
+        .dpb_size   = 1,
+    };
+    return vout_Request( p_aout, &cfg );
 }
 
 vout_thread_t *aout_filter_RequestVout( filter_t *p_filter,
@@ -838,8 +838,8 @@ vout_thread_t *aout_filter_RequestVout( filter_t *p_filter,
 static int ChangeFiltersString( aout_instance_t * p_aout, const char* psz_variable,
                                  const char *psz_name, bool b_add )
 {
-    return AoutChangeFilterString( VLC_OBJECT(p_aout), p_aout,
-                                   psz_variable, psz_name, b_add ) ? 1 : 0;
+    return aout_ChangeFilterString( VLC_OBJECT(p_aout), p_aout,
+                                    psz_variable, psz_name, b_add ) ? 1 : 0;
 }
 
 static int VisualizationCallback( vlc_object_t *p_this, char const *psz_cmd,