diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2011-10-16 00:44:22 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2011-10-16 00:51:36 +0200 |
commit | cc6b8c4b612d239bef31a8115402b03453c2b4bc (patch) | |
tree | 385b3be1ba455196627a3c6ebd5cfc978b9f6ec2 /libavfilter | |
parent | 7d2e4673b1528fb1e4838db05d9edca6393ced22 (diff) | |
download | ffmpeg-streaming-cc6b8c4b612d239bef31a8115402b03453c2b4bc.zip ffmpeg-streaming-cc6b8c4b612d239bef31a8115402b03453c2b4bc.tar.gz |
af_ashowinfo: adopt used plane size when computing the plane checksum
Fix checksum computation when the used plane size is different from the
allocated plane size, as it was wrongly assumed.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_ashowinfo.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/af_ashowinfo.c b/libavfilter/af_ashowinfo.c index 25ec342..c8e4d31 100644 --- a/libavfilter/af_ashowinfo.c +++ b/libavfilter/af_ashowinfo.c @@ -45,10 +45,13 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) uint32_t plane_checksum[8] = {0}, checksum = 0; char chlayout_str[128]; int plane; + int linesize = + av_get_channel_layout_nb_channels(samplesref->audio->channel_layout) * + samplesref->audio->nb_samples * + av_get_bytes_per_sample(samplesref->format); for (plane = 0; samplesref->data[plane] && plane < 8; plane++) { uint8_t *data = samplesref->data[plane]; - int linesize = samplesref->linesize[plane]; plane_checksum[plane] = av_adler32_update(plane_checksum[plane], data, linesize); |