mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
flacdec: get total number of samples from STREAMINFO
Originally committed as revision 16768 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
7fa9a0a256
commit
aeb987cebf
@ -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
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user