[FFmpeg-devel] [PATCH] Fix step size logic in avfilter_default_get_audio_buffer().
Stefano Sabatini
stefano.sabatini-lala
Sat Jan 15 02:26:03 CET 2011
---
libavfilter/defaults.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c
index aa3739c..4b77c34 100644
--- a/libavfilter/defaults.c
+++ b/libavfilter/defaults.c
@@ -92,10 +92,10 @@ AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int per
/* Set the number of bytes to traverse to reach next sample of a particular channel:
* For planar, this is simply the sample size.
- * For packed, this is the number of samples * sample_size.
+ * For packed, this is the number of channels * sample_size.
*/
for (i = 0; i < chans_nb; i++)
- samples->linesize[i] = planar > 0 ? per_channel_size : sample_size;
+ samples->linesize[i] = planar ? sample_size : chans_nb * sample_size;
memset(&samples->linesize[chans_nb], 0, (8-chans_nb) * sizeof(samples->linesize[0]));
/* Calculate total buffer size, round to multiple of 16 to be SIMD friendly */
--
1.7.2.3
More information about the ffmpeg-devel
mailing list