From: Mike Brady Date: Sun, 28 Apr 2019 20:39:42 +0000 (+0100) Subject: Add "auto" interpolation support to the dbus interface. X-Git-Tag: 3.3rc5~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=848467a817ed1aa24d3cd97067e57374136b8762;p=thirdparty%2Fshairport-sync.git Add "auto" interpolation support to the dbus interface. --- diff --git a/dbus-service.c b/dbus-service.c index a1cde3fd..5025344f 100644 --- a/dbus-service.c +++ b/dbus-service.c @@ -501,6 +501,8 @@ gboolean notify_interpolation_callback(ShairportSync *skeleton, config.packet_stuffing = ST_basic; else if (strcasecmp(th, "soxr") == 0) config.packet_stuffing = ST_soxr; + else if (strcasecmp(th, "auto") == 0) + config.packet_stuffing = ST_auto; else { warn("An unrecognised interpolation method: \"%s\" was requested via the D-Bus interface.", th); switch (config.packet_stuffing) { @@ -510,6 +512,9 @@ gboolean notify_interpolation_callback(ShairportSync *skeleton, case ST_soxr: shairport_sync_set_interpolation(skeleton, "soxr"); break; + case ST_auto: + shairport_sync_set_interpolation(skeleton, "auto"); + break; default: debug(1, "This should never happen!"); shairport_sync_set_interpolation(skeleton, "basic"); @@ -765,14 +770,21 @@ static void on_dbus_name_acquired(GDBusConnection *connection, const gchar *name if (config.packet_stuffing == ST_basic) { shairport_sync_set_interpolation(SHAIRPORT_SYNC(shairportSyncSkeleton), "basic"); debug(1, ">> interpolation set to \"basic\" (soxr support built in)"); + } else if (config.packet_stuffing == ST_auto) { + shairport_sync_set_interpolation(SHAIRPORT_SYNC(shairportSyncSkeleton), "auto"); + debug(1, ">> interpolation set to \"auto\" (soxr support built in)"); } else { shairport_sync_set_interpolation(SHAIRPORT_SYNC(shairportSyncSkeleton), "soxr"); debug(1, ">> interpolation set to \"soxr\""); } #else - shairport_sync_set_interpolation(SHAIRPORT_SYNC(shairportSyncSkeleton), "basic"); - debug(1, ">> interpolation set to \"basic\" (no soxr support)"); - + if (config.packet_stuffing == ST_basic) { + shairport_sync_set_interpolation(SHAIRPORT_SYNC(shairportSyncSkeleton), "basic"); + debug(1, ">> interpolation set to \"basic\" (no soxr support)"); + } else if (config.packet_stuffing == ST_auto) { + shairport_sync_set_interpolation(SHAIRPORT_SYNC(shairportSyncSkeleton), "auto"); + debug(1, ">> interpolation set to \"auto\" (no soxr support)"); + } #endif if (config.volume_control_profile == VCP_standard)