]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
a52: Correct data transfer in planar mode
authorTakashi Iwai <tiwai@suse.de>
Tue, 15 Jun 2021 17:31:18 +0000 (19:31 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 16 Jun 2021 06:53:53 +0000 (08:53 +0200)
The buffer offset was incorrectly calculated in samples.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
a52/pcm_a52.c

index b1a07b4db63e926532a35474f74267f9cee1153e..95d2c3f118b9ff7bf1f9b7e741ca870d5fd5c0a2 100644 (file)
@@ -332,7 +332,7 @@ static int fill_data(snd_pcm_ioplug_t *io,
 
 #ifdef USE_AVCODEC_FRAME
                        if (use_planar(rec) && !interleaved) {
-                               memcpy(rec->frame->data[ch] + rec->filled, src, size * 2);
+                               memcpy(rec->frame->data[ch] + rec->filled * 2, src, size * 2);
                                continue;
                        }
 #endif
@@ -358,7 +358,7 @@ static int fill_data(snd_pcm_ioplug_t *io,
 
 #ifdef USE_AVCODEC_FRAME
                        if (use_planar(rec) && !interleaved) {
-                               memcpy(rec->frame->data[ch] + rec->filled, src, size * 4);
+                               memcpy(rec->frame->data[ch] + rec->filled * 4, src, size * 4);
                                continue;
                        }
 #endif