mirror of
https://github.com/mpv-player/mpv
synced 2025-01-13 02:16:40 +00:00
audio: avoid returning audio-device-list entries without description
Use the device name as fallback. This is ugly, but still better than skipping the description entirely. This can be an issue on ALSA, where the API can return entries without proper description.
This commit is contained in:
parent
cf85191cb7
commit
84513ba58b
@ -95,6 +95,8 @@ Interface changes
|
||||
--terminal, --osc, --ytdl, can all be enable/disabled after
|
||||
mpv_initialize() - this can be extended to other still fixed options
|
||||
on user requests)
|
||||
- the "audio-device-list" property now sets empty device description to the
|
||||
device name as a fallback
|
||||
--- mpv 0.20.0 ---
|
||||
- add --image-display-duration option - this also means that image duration
|
||||
is not influenced by --mf-fps anymore in the general case (this is an
|
||||
|
@ -1912,8 +1912,9 @@ Property list
|
||||
|
||||
The ``name`` is what is to be passed to the ``--audio-device`` option (and
|
||||
often a rather cryptic audio API-specific ID), while ``description`` is
|
||||
human readable free form text. The description is an empty string if none
|
||||
was received.
|
||||
human readable free form text. The description is set to the device name
|
||||
(minus mpv-specific ``<driver>/`` prefix) if no description is available
|
||||
or the description would have been an empty string.
|
||||
|
||||
The special entry with the name set to ``auto`` selects the default audio
|
||||
output driver and the default device.
|
||||
|
@ -599,6 +599,8 @@ void ao_device_list_add(struct ao_device_list *list, struct ao *ao,
|
||||
{
|
||||
struct ao_device_desc c = *e;
|
||||
const char *dname = ao->driver->name;
|
||||
if ((!c.desc || !c.desc[0]) && c.name)
|
||||
c.desc = c.name;
|
||||
c.name = c.name[0] ? talloc_asprintf(list, "%s/%s", dname, c.name)
|
||||
: talloc_strdup(list, dname);
|
||||
c.desc = talloc_strdup(list, c.desc);
|
||||
|
Loading…
Reference in New Issue
Block a user