[vlc-devel] [PATCH] audio_output: use vlc_list to keep the list of plugged devices

Rémi Denis-Courmont remi at remlab.net
Mon Nov 23 21:16:05 CET 2020


> @@ -119,9 +121,8 @@ static void aout_HotplugNotify (audio_output_t *aout,
>              dev = malloc (sizeof (*dev) + strlen (id));
>              if (unlikely(dev == NULL))
>                  goto out;
> -            dev->next = NULL;
>              strcpy (dev->id, id);
> -            *pp = dev;
> +            vlc_list_prepend(&dev->node, &owner->dev.list);

*append* to preserve order.

Yes the current code effectively prepends, but that's only to save one pointer 
per audio output. That "benefit" is lost when using vlc_list.

>              owner->dev.count++;
>          }
>          else /* Modified device */

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list