# 35_alsa_dev_add_dev_custom_call.patch
#
# Patch 05_audio_device changed add_dev()'s signature from
#
#     static pj_status_t add_dev(struct alsa_factory *af,
#                                const char *dev_name);
#
# to
#
#     static pj_status_t add_dev(struct alsa_factory *af,
#                                const char *dev_name,
#                                const char *dev_desc);
#
# (so the comprehensive-name code path in 2.17 can format
#  `<desc>, Digital (S/PDIF)` etc.) and updated the snd_device_name_*
# enumeration call site to pass the description string.
#
# It did NOT update the custom-device branch, which iterates over
# af->custom_dev[] (user-supplied ALSA device strings from the
# python sipsimple AudioDevice setting) and still passes only two
# arguments:
#
#     for (i = 0; i < af->custom_dev_cnt; ++i) {
#         add_dev(af, af->custom_dev[i].ptr);    <-- missing dev_desc
#     }
#
# On Linux Trixie / GCC 13+ this is a hard error:
#
#     error: too few arguments to function 'add_dev'
#
# Older GCCs would only warn; newer toolchains promote it to an
# error and the build halts at libpjmedia-audiodev.a.
#
# Fix: pass NULL for dev_desc.  add_dev() already guards every use
# of dev_desc with `if (dev_desc) { ... }`, so NULL just skips the
# comprehensive-name formatting and falls back to using dev_name as
# the displayed name - which is the correct semantic for a custom
# user-supplied device string anyway (we don't know the human-
# readable description of an arbitrary ALSA device name).
#
# Linux-only: alsa_dev.c is not compiled on Darwin or Windows.
#
--- pjsip_orig/pjmedia/src/pjmedia-audiodev/alsa_dev.c
+++ pjsip/pjmedia/src/pjmedia-audiodev/alsa_dev.c
@@ -504,6 +504,6 @@
     } else {
         unsigned i;
         for (i = 0; i < af->custom_dev_cnt; ++i) {
-            add_dev(af, af->custom_dev[i].ptr);
+            add_dev(af, af->custom_dev[i].ptr, NULL);
         }
     }
