summaryrefslogtreecommitdiffstats
path: root/audio/audio.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-25 19:10:24 +0200
committerwm4 <wm4@nowhere>2015-06-25 19:10:24 +0200
commit5a3cdb8f1e8b14daf11d44ef729a2484982b7305 (patch)
tree57369f90adb2e163dffc86b2649e7ba1d0f08077 /audio/audio.c
parentfd1194de3c4b14126269f2db918c0f8bcf2bf34a (diff)
downloadmpv-5a3cdb8f1e8b14daf11d44ef729a2484982b7305.tar.bz2
mpv-5a3cdb8f1e8b14daf11d44ef729a2484982b7305.tar.xz
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.)
Diffstat (limited to 'audio/audio.c')
-rw-r--r--audio/audio.c8
1 files changed, 6 insertions, 2 deletions
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;
}