diff options
author | wm4 <wm4@nowhere> | 2014-11-24 19:56:01 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-24 19:56:01 +0100 |
commit | 28b6ce39d3d88d0159b54c8ca558e993eac93056 (patch) | |
tree | fa3c94a84cd2efebf24b1ea5fd75dd1fbcc01c12 /audio/chmap.h | |
parent | 2228d4737367fb0303bec263bc06ca90c9ff8757 (diff) | |
download | mpv-28b6ce39d3d88d0159b54c8ca558e993eac93056.tar.bz2 mpv-28b6ce39d3d88d0159b54c8ca558e993eac93056.tar.xz |
audio: make mp_chmap_to_str() return a stack-allocated string
Simplifies memory management.
Diffstat (limited to 'audio/chmap.h')
-rw-r--r-- | audio/chmap.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/chmap.h b/audio/chmap.h index c7851a8657..d0b9806ff5 100644 --- a/audio/chmap.h +++ b/audio/chmap.h @@ -120,7 +120,9 @@ void mp_chmap_reorder_to_lavc(struct mp_chmap *map); void mp_chmap_get_reorder(int dst[MP_NUM_CHANNELS], const struct mp_chmap *from, const struct mp_chmap *to); -char *mp_chmap_to_str(const struct mp_chmap *src); +char *mp_chmap_to_str_buf(char *buf, size_t buf_size, const struct mp_chmap *src); +#define mp_chmap_to_str(m) mp_chmap_to_str_buf((char[64]){0}, 64, (m)) + bool mp_chmap_from_str(struct mp_chmap *dst, bstr src); struct mp_log; |