summaryrefslogtreecommitdiff
path: root/contrib/ffmpeg/libavcodec/bitstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ffmpeg/libavcodec/bitstream.c')
-rw-r--r--contrib/ffmpeg/libavcodec/bitstream.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/contrib/ffmpeg/libavcodec/bitstream.c b/contrib/ffmpeg/libavcodec/bitstream.c
index 22d256df5..a0c239798 100644
--- a/contrib/ffmpeg/libavcodec/bitstream.c
+++ b/contrib/ffmpeg/libavcodec/bitstream.c
@@ -30,6 +30,15 @@
#include "avcodec.h"
#include "bitstream.h"
+/**
+ * Same as av_mallocz_static(), but does a realloc.
+ *
+ * @param[in] ptr The block of memory to reallocate.
+ * @param[in] size The requested size.
+ * @return Block of memory of requested size.
+ */
+attribute_deprecated void *ff_realloc_static(void *ptr, unsigned int size);
+
void align_put_bits(PutBitContext *s)
{
#ifdef ALT_BITSTREAM_WRITER
@@ -78,7 +87,7 @@ static int alloc_table(VLC *vlc, int size, int use_static)
if (vlc->table_size > vlc->table_allocated) {
vlc->table_allocated += (1 << vlc->bits);
if(use_static)
- vlc->table = av_realloc_static(vlc->table,
+ vlc->table = ff_realloc_static(vlc->table,
sizeof(VLC_TYPE) * 2 * vlc->table_allocated);
else
vlc->table = av_realloc(vlc->table,
@@ -218,10 +227,10 @@ static int build_table(VLC *vlc, int table_nb_bits,
int init_vlc(VLC *vlc, int nb_bits, int nb_codes,
const void *bits, int bits_wrap, int bits_size,
const void *codes, int codes_wrap, int codes_size,
- int use_static)
+ int flags)
{
vlc->bits = nb_bits;
- if(!use_static) {
+ if(!(flags & INIT_VLC_USE_STATIC)) {
vlc->table = NULL;
vlc->table_allocated = 0;
vlc->table_size = 0;
@@ -239,7 +248,7 @@ int init_vlc(VLC *vlc, int nb_bits, int nb_codes,
if (build_table(vlc, nb_bits, nb_codes,
bits, bits_wrap, bits_size,
codes, codes_wrap, codes_size,
- 0, 0, use_static) < 0) {
+ 0, 0, flags) < 0) {
av_free(vlc->table);
return -1;
}