#include "libavutil/crc.h"
#include "avcodec.h"
#include "internal.h"
-#include "bitstream.h"
+#include "get_bits.h"
#include "bytestream.h"
#include "golomb.h"
#include "flac.h"
/* initialize based on the demuxer-supplied streamdata header */
ff_flac_parse_streaminfo(avctx, (FLACStreaminfo *)s, streaminfo);
+ if (s->bps > 16)
+ avctx->sample_fmt = SAMPLE_FMT_S32;
+ else
+ avctx->sample_fmt = SAMPLE_FMT_S16;
allocate_buffers(s);
s->got_streaminfo = 1;
avctx->channels = s->channels;
avctx->sample_rate = s->samplerate;
avctx->bits_per_raw_sample = s->bps;
- if (s->bps > 16)
- avctx->sample_fmt = SAMPLE_FMT_S32;
- else
- avctx->sample_fmt = SAMPLE_FMT_S16;
s->samples = get_bits_long(&gb, 32) << 4;
s->samples |= get_bits(&gb, 4);
{
int i, j;
int coeff_prec, qlevel;
- int coeffs[pred_order];
+ int coeffs[32];
int32_t *decoded = s->decoded[channel];
/* warm up samples */
s->curr_bps -= wasted;
}
if (s->curr_bps > 32) {
- ff_log_missing_feature(s->avctx, "decorrelated bit depth > 32", 0);
+ av_log_missing_feature(s->avctx, "decorrelated bit depth > 32", 0);
return -1;
}
static int flac_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- const uint8_t *buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
FLACContext *s = avctx->priv_data;
int i, j = 0, input_buf_size = 0, bytes_read = 0;
int16_t *samples_16 = data;
NULL,
flac_decode_close,
flac_decode_frame,
- CODEC_CAP_DELAY,
+ CODEC_CAP_DELAY | CODEC_CAP_SUBFRAMES, /* FIXME: add a FLAC parser so that
+ we will not need to use either
+ of these capabilities */
.flush= flac_flush,
.long_name= NULL_IF_CONFIG_SMALL("FLAC (Free Lossless Audio Codec)"),
};