summaryrefslogtreecommitdiffstats
path: root/libavcodec/g722enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/g722enc.c')
-rw-r--r--libavcodec/g722enc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/g722enc.c b/libavcodec/g722enc.c
index cc87936..d3c7298 100644
--- a/libavcodec/g722enc.c
+++ b/libavcodec/g722enc.c
@@ -27,6 +27,7 @@
* G.722 ADPCM audio encoder
*/
+#include "libavutil/avassert.h"
#include "avcodec.h"
#include "internal.h"
#include "g722.h"
@@ -247,7 +248,7 @@ static void g722_encode_trellis(G722Context *c, int trellis,
continue;\
if (heap_pos[index] < frontier) {\
pos = heap_pos[index]++;\
- assert(pathn[index] < FREEZE_INTERVAL * frontier);\
+ av_assert2(pathn[index] < FREEZE_INTERVAL * frontier);\
node = nodes_next[index][pos] = next[index]++;\
node->path = pathn[index]++;\
} else {\
@@ -367,10 +368,8 @@ static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
int nb_samples, out_size, ret;
out_size = (frame->nb_samples + 1) / 2;
- if ((ret = ff_alloc_packet(avpkt, out_size))) {
- av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
+ if ((ret = ff_alloc_packet2(avctx, avpkt, out_size)))
return ret;
- }
nb_samples = frame->nb_samples - (frame->nb_samples & 1);
OpenPOWER on IntegriCloud