summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_sweep.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-10 23:11:40 +0100
committerwm4 <wm4@nowhere>2013-11-12 23:16:31 +0100
commitd2e7467eb203d3a34bc1111564c7058b5e9c6b12 (patch)
tree9285523821c8710a0609f47e3ee923a20d038826 /audio/filter/af_sweep.c
parentb2d4b5ee43206f8c4491b3af1c24fedd35dbdc31 (diff)
downloadmpv-d2e7467eb203d3a34bc1111564c7058b5e9c6b12.tar.bz2
mpv-d2e7467eb203d3a34bc1111564c7058b5e9c6b12.tar.xz
audio/filter: prepare filter chain for non-interleaved audio
Based on earlier work by Stefano Pigozzi. There are 2 changes: 1. Instead of mp_audio.audio, mp_audio.planes[0] must be used. 2. mp_audio.len used to contain the size of the audio in bytes. Now mp_audio.samples must be used. (Where 1 sample is the smallest unit of audio that covers all channels.) Also, some filters need changes to reject non-interleaved formats properly. Nothing uses the non-interleaved features yet, but this is needed so that things don't just break when doing so.
Diffstat (limited to 'audio/filter/af_sweep.c')
-rw-r--r--audio/filter/af_sweep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/filter/af_sweep.c b/audio/filter/af_sweep.c
index 0a140dcb65..daa2891219 100644
--- a/audio/filter/af_sweep.c
+++ b/audio/filter/af_sweep.c
@@ -67,9 +67,9 @@ static struct mp_audio* play(struct af_instance* af, struct mp_audio* data)
{
af_sweept *s = af->setup;
int i, j;
- int16_t *in = (int16_t*)data->audio;
+ int16_t *in = (int16_t*)data->planes[0];
int chans = data->nch;
- int in_len = data->len/(2*chans);
+ int in_len = data->samples;
for(i=0; i<in_len; i++){
for(j=0; j<chans; j++)