#include "libavutil/channel_layout.h"
#include "libavutil/float_dsp.h"
-#include "libavutil/mem.h"
+#include "libavutil/mem_internal.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "internal.h"
static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
{
static AVOnce init_static_once = AV_ONCE_INIT;
- int n, flags, pitch_range, lsp16_flag;
+ int n, flags, pitch_range, lsp16_flag, ret;
WMAVoiceContext *s = ctx->priv_data;
ff_thread_once(&init_static_once, wmavoice_init_static_data);
s->spillover_bitsize = 3 + av_ceil_log2(ctx->block_align);
s->do_apf = flags & 0x1;
if (s->do_apf) {
- ff_rdft_init(&s->rdft, 7, DFT_R2C);
- ff_rdft_init(&s->irdft, 7, IDFT_C2R);
- ff_dct_init(&s->dct, 6, DCT_I);
- ff_dct_init(&s->dst, 6, DST_I);
+ if ((ret = ff_rdft_init(&s->rdft, 7, DFT_R2C)) < 0 ||
+ (ret = ff_rdft_init(&s->irdft, 7, IDFT_C2R)) < 0 ||
+ (ret = ff_dct_init (&s->dct, 6, DCT_I)) < 0 ||
+ (ret = ff_dct_init (&s->dst, 6, DST_I)) < 0)
+ return ret;
ff_sine_window_init(s->cos, 256);
memcpy(&s->sin[255], s->cos, 256 * sizeof(s->cos[0]));
* @param size size of the source data, in bytes
* @param gb bit I/O context specifying the current position in the source.
* data. This function might use this to align the bit position to
- * a whole-byte boundary before calling #avpriv_copy_bits() on aligned
+ * a whole-byte boundary before calling #ff_copy_bits() on aligned
* source data
* @param nbits the amount of bits to copy from source to target
*
rmn_bits = rmn_bytes = get_bits_left(gb);
if (rmn_bits < nbits)
return;
- if (nbits > pb->size_in_bits - put_bits_count(pb))
+ if (nbits > put_bits_left(pb))
return;
rmn_bits &= 7; rmn_bytes >>= 3;
if ((rmn_bits = FFMIN(rmn_bits, nbits)) > 0)
put_bits(pb, rmn_bits, get_bits(gb, rmn_bits));
- avpriv_copy_bits(pb, data + size - rmn_bytes,
+ ff_copy_bits(pb, data + size - rmn_bytes,
FFMIN(nbits - rmn_bits, rmn_bytes << 3));
}
return 0;
}
-AVCodec ff_wmavoice_decoder = {
+const AVCodec ff_wmavoice_decoder = {
.name = "wmavoice",
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Audio Voice"),
.type = AVMEDIA_TYPE_AUDIO,