diff options
author | wm4 <wm4@nowhere> | 2013-05-09 12:56:16 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-05-12 21:24:54 +0200 |
commit | 37325f2796afd914ee729cafc3a1624f333a9ae7 (patch) | |
tree | da90f5eabb9856c38a59ff43f315017c58540be1 /audio | |
parent | 7971bb87cb46f90152913de6ac673ae3bd1637a3 (diff) | |
download | mpv-37325f2796afd914ee729cafc3a1624f333a9ae7.tar.bz2 mpv-37325f2796afd914ee729cafc3a1624f333a9ae7.tar.xz |
af_pan: set unknown channel layout for output
Diffstat (limited to 'audio')
-rw-r--r-- | audio/filter/af_pan.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/audio/filter/af_pan.c b/audio/filter/af_pan.c index 398ffe3b33..d6f7538868 100644 --- a/audio/filter/af_pan.c +++ b/audio/filter/af_pan.c @@ -34,6 +34,15 @@ typedef struct af_pan_s float level[AF_NCH][AF_NCH]; // Gain level for each channel }af_pan_t; +static void set_channels(struct mp_audio *mpa, int num) +{ + struct mp_chmap map; + // "unknown" channel layouts make it easier to pass through audio data, + // without triggering remixing. + mp_chmap_set_unknown(&map, num); + mp_audio_set_channels(mpa, &map); +} + // Initialization and runtime control static int control(struct af_instance* af, int cmd, void* arg) { @@ -46,7 +55,7 @@ static int control(struct af_instance* af, int cmd, void* arg) af->data->rate = ((struct mp_audio*)arg)->rate; mp_audio_set_format(af->data, AF_FORMAT_FLOAT_NE); - mp_audio_set_num_channels(af->data, s->nch ? s->nch: ((struct mp_audio*)arg)->nch); + set_channels(af->data, s->nch ? s->nch: ((struct mp_audio*)arg)->nch); af->mul = (double)af->data->nch / ((struct mp_audio*)arg)->nch; if((af->data->format != ((struct mp_audio*)arg)->format) || @@ -176,7 +185,7 @@ static struct mp_audio* play(struct af_instance* af, struct mp_audio* data) // Set output data c->audio = l->audio; c->len = c->len / c->nch * l->nch; - mp_audio_set_num_channels(c, l->nch); + set_channels(c, l->nch); return c; } |