]> git.sesse.net Git - vlc/commitdiff
aout: remove choices list on the device variable
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 14 Jan 2013 17:41:40 +0000 (19:41 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 14 Jan 2013 17:41:40 +0000 (19:41 +0200)
This does not support hot plug and unplug of devices.

Also, it prevented selecting a device not in the choices list due to
checks in the variables subsystem. (At least with ALSA, not all valid
devices are included in the suggestions.)

src/audio_output/output.c

index a0137f8b023630a42d15ced67ed12eecf10a4460..a108328e01591c414f4b0a9755464b748c1c5bb3 100644 (file)
@@ -113,8 +113,6 @@ audio_output_t *aout_New (vlc_object_t *parent)
     var_Create (aout, "mute", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
     var_AddCallback (aout, "mute", var_Copy, parent);
     var_Create (aout, "device", VLC_VAR_STRING | VLC_VAR_HASCHOICE);
-    text.psz_string = _("Audio Device");
-    var_Change (aout, "device", VLC_VAR_SETTEXT, &text, NULL);
 
     aout->event.volume_report = aout_VolumeNotify;
     aout->event.mute_report = aout_MuteNotify;
@@ -138,27 +136,6 @@ audio_output_t *aout_New (vlc_object_t *parent)
         return NULL;
     }
 
-    if (aout->device_enum != NULL)
-    {   /* Backward compatibility with UIs using GETCHOICES/GETLIST */
-        /* Note: this does NOT support hot-plugged devices. */
-        char **ids, **names;
-        int n = aout->device_enum (aout, &ids, &names);
-
-        for (int i = 0; i < n; i++)
-        {
-            val.psz_string = ids[i];
-            text.psz_string = names[i];
-            var_Change (aout, "device", VLC_VAR_ADDCHOICE, &val, &text);
-            free (names[i]);
-            free (ids[i]);
-        }
-        if (n >= 0)
-        {
-            free (names);
-            free (ids);
-        }
-    }
-
     /*
      * Persistent audio output variables
      */