From 5a3cdb8f1e8b14daf11d44ef729a2484982b7305 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 25 Jun 2015 19:10:24 +0200 Subject: audio: output human-readable channel layouts too This gets you the "logical" channel layout, instead of the exact thing we're sending to the AO. (Tired of the cryptic shit ALSA gives me.) --- audio/audio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'audio/audio.c') diff --git a/audio/audio.c b/audio/audio.c index a61e8c458c..c4ffc233a1 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -93,9 +93,13 @@ bool mp_audio_config_valid(const struct mp_audio *mpa) char *mp_audio_config_to_str_buf(char *buf, size_t buf_sz, struct mp_audio *mpa) { + char ch[128]; + mp_chmap_to_str_buf(ch, sizeof(ch), &mpa->channels); + char *hr_ch = mp_chmap_to_str_hr(&mpa->channels); + if (strcmp(hr_ch, ch) != 0) + mp_snprintf_cat(ch, sizeof(ch), " (%s)", hr_ch); snprintf(buf, buf_sz, "%dHz %s %dch %s", mpa->rate, - mp_chmap_to_str(&mpa->channels), mpa->channels.num, - af_fmt_to_str(mpa->format)); + ch, mpa->channels.num, af_fmt_to_str(mpa->format)); return buf; } -- cgit v1.2.3