[FFmpeg-cvslog] wavpack: calculate bpp using av_get_bytes_per_sample()

Justin Ruggles git at videolan.org
Mon Oct 24 01:58:25 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Fri Sep 23 23:19:53 2011 -0400| [d2604f9260669a56caeca16f4d8beed488c5e53d] | committer: Justin Ruggles

wavpack: calculate bpp using av_get_bytes_per_sample()

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d2604f9260669a56caeca16f4d8beed488c5e53d
---

 libavcodec/wavpack.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 5cd17b5..ec46fb1 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -808,15 +808,13 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
     }
     s->frame_flags = AV_RL32(buf); buf += 4;
     if(s->frame_flags&0x80){
-        bpp = sizeof(float);
         avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
     } else if((s->frame_flags&0x03) <= 1){
-        bpp = 2;
         avctx->sample_fmt = AV_SAMPLE_FMT_S16;
     } else {
-        bpp = 4;
         avctx->sample_fmt = AV_SAMPLE_FMT_S32;
     }
+    bpp = av_get_bytes_per_sample(avctx->sample_fmt);
     samples = (uint8_t*)samples + bpp * wc->ch_offset;
 
     s->stereo = !(s->frame_flags & WV_MONO);



More information about the ffmpeg-cvslog mailing list