| 261 | } |
| 262 | |
| 263 | static int decode_frame(AVCodecContext *avctx, |
| 264 | void *data, int *data_size, |
| 265 | AVPacket *avpkt) |
| 266 | { |
| 267 | BinkAudioContext *s = avctx->priv_data; |
| 268 | const uint8_t *buf = avpkt->data; |
| 269 | int buf_size = avpkt->size; |
| 270 | short *samples = data; |
| 271 | short *samples_end = (short*)((uint8_t*)data + *data_size); |
| 272 | int reported_size; |
| 273 | GetBitContext *gb = &s->gb; |
| 274 | |
| 275 | init_get_bits(gb, buf, buf_size * 8); |
| 276 | |
| 277 | reported_size = get_bits_long(gb, 32); |
| 278 | while (get_bits_count(gb) / 8 < buf_size && |
| 279 | samples + s->block_size <= samples_end) { |
| 280 | decode_block(s, samples, avctx->codec->id == CODEC_ID_BINKAUDIO_DCT); |
| 281 | samples += s->block_size; |
| 282 | get_bits_align32(gb); |
| 283 | } |
| 284 | |
| 285 | *data_size = FFMIN(reported_size, (uint8_t*)samples - (uint8_t*)data); |
| 286 | return buf_size; |
| 287 | } |
| 288 | |
| 289 | AVCodec binkaudio_rdft_decoder = { |
| 290 | "binkaudio_rdft", |
nothing calls this directly
no test coverage detected