X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavformat%2Fflacdec.c;h=1a8dc19af3e5e07cd428c0b030f3ed647e411541;hp=c291393954d15f0be07f79c27a3863d39c2ff91d;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavformat/flacdec.c b/ffmpeg/libavformat/flacdec.c index c291393..1a8dc19 100644 --- a/ffmpeg/libavformat/flacdec.c +++ b/ffmpeg/libavformat/flacdec.c @@ -27,7 +27,6 @@ #include "oggdec.h" #include "vorbiscomment.h" #include "replaygain.h" -#include "libavcodec/bytestream.h" static int flac_read_header(AVFormatContext *s) { @@ -75,7 +74,9 @@ static int flac_read_header(AVFormatContext *s) } if (metadata_type == FLAC_METADATA_TYPE_STREAMINFO) { - FLACStreaminfo si; + uint32_t samplerate; + uint64_t samples; + /* STREAMINFO can only occur once */ if (found_streaminfo) { RETURN_ERROR(AVERROR_INVALIDDATA); @@ -88,14 +89,16 @@ static int flac_read_header(AVFormatContext *s) st->codec->extradata_size = metadata_size; buffer = NULL; - /* get codec params from STREAMINFO header */ - avpriv_flac_parse_streaminfo(st->codec, &si, st->codec->extradata); + /* get sample rate and sample count from STREAMINFO header; + * other parameters will be extracted by the parser */ + samplerate = AV_RB24(st->codec->extradata + 10) >> 4; + samples = (AV_RB64(st->codec->extradata + 13) >> 24) & ((1ULL << 36) - 1); /* set time base and duration */ - if (si.samplerate > 0) { - avpriv_set_pts_info(st, 64, 1, si.samplerate); - if (si.samples > 0) - st->duration = si.samples; + if (samplerate > 0) { + avpriv_set_pts_info(st, 64, 1, samplerate); + if (samples > 0) + st->duration = samples; } } else if (metadata_type == FLAC_METADATA_TYPE_CUESHEET) { uint8_t isrc[13];