From aeb987cebf021192979ee162d82ab2577d62f72e Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Sun, 25 Jan 2009 02:27:02 +0000 Subject: [PATCH] flacdec: get total number of samples from STREAMINFO Originally committed as revision 16768 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/flac.h | 1 + libavcodec/flacdec.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/flac.h b/libavcodec/flac.h index 246ec44..02b41e1 100644 --- a/libavcodec/flac.h +++ b/libavcodec/flac.h @@ -53,6 +53,7 @@ enum { int samplerate; /**< sample rate */\ int channels; /**< number of channels */\ int bps; /**< bits-per-sample */\ + int64_t samples; /**< total number of samples */\ typedef struct FLACStreaminfo { FLACSTREAMINFO diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 7ebf015..ee3a3f2 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -169,7 +169,8 @@ void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, avctx->channels = s->channels; avctx->sample_rate = s->samplerate; - skip_bits(&gb, 36); /* total num of samples */ + s->samples = get_bits_long(&gb, 32) << 4; + s->samples |= get_bits_long(&gb, 4); skip_bits(&gb, 64); /* md5 sum */ skip_bits(&gb, 64); /* md5 sum */ -- 2.7.4