}
start_ch += chans;
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, 8192 * s->channels))) {
- av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 8192 * s->channels)) < 0)
return ret;
- }
do {
int frame_bits;
ff_ac3_quantize_mantissas(s);
- if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size)) < 0)
return ret;
ff_ac3_output_frame(s, avpkt->data);
pkt_size = (2 + avctx->channels * (22 + 4 * (frame->nb_samples - 1)) + 7) / 8;
else
pkt_size = avctx->block_align;
- if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size)) < 0)
return ret;
dst = avpkt->data;
else
max_frame_size = s->max_coded_frame_size;
- if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * max_frame_size)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * max_frame_size)) < 0)
return ret;
/* use verbatim mode for compression_level 0 */
const int16_t *samples;
int ret, real_channel = 0;
- if ((ret = ff_alloc_packet2(avctx, avpkt, DCA_MAX_FRAME_SIZE + DCA_HEADER_SIZE)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, DCA_MAX_FRAME_SIZE + DCA_HEADER_SIZE)) < 0)
return ret;
samples = (const int16_t *)frame->data[0];
}
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, frame_bytes)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, frame_bytes)) < 0)
return ret;
out_bytes = write_frame(s, avpkt);
int nb_samples, out_size, ret;
out_size = (frame->nb_samples + 1) / 2;
- if ((ret = ff_alloc_packet2(avctx, avpkt, out_size)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, out_size)) < 0)
return ret;
nb_samples = frame->nb_samples - (frame->nb_samples & 1);
offset += LPC_ORDER;
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, 24)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 24)) < 0)
return ret;
*got_packet_ptr = 1;
int i, ret, out_size;
out_size = (frame->nb_samples * c->code_size + 7) / 8;
- if ((ret = ff_alloc_packet2(avctx, avpkt, out_size)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, out_size)) < 0)
return ret;
init_put_bits(&pb, avpkt->data, avpkt->size);
int32_t *input_buffer = (int32_t *)frame->data[0];
int ret;
- if ((ret = ff_alloc_packet2(avctx, pkt, s->max_output_bytes)))
+ if ((ret = ff_alloc_packet2(avctx, pkt, s->max_output_bytes)) < 0)
return ret;
pkt->size = aacplusEncEncode(s->aacplus_handle, input_buffer,
int num_samples = frame ? frame->nb_samples : 0;
void *samples = frame ? frame->data[0] : NULL;
- if ((ret = ff_alloc_packet2(avctx, avpkt, (7 + 768) * avctx->channels))) {
- av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
+ if ((ret = ff_alloc_packet2(avctx, avpkt, (7 + 768) * avctx->channels)) < 0)
return ret;
- }
bytes_written = faacEncEncode(s->faac_handle, samples,
num_samples * avctx->channels,
}
/* The maximum packet size is 6144 bits aka 768 bytes per channel. */
- if ((ret = ff_alloc_packet2(avctx, avpkt, FFMAX(8192, 768 * avctx->channels))))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, FFMAX(8192, 768 * avctx->channels))) < 0)
return ret;
out_ptr = avpkt->data;
gsm_signal *samples = (gsm_signal *)frame->data[0];
struct gsm_state *state = avctx->priv_data;
- if ((ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, avctx->block_align)) < 0)
return ret;
switch(avctx->codec_id) {
av_dlog(avctx, "in:%d packet-len:%d index:%d\n", avctx->frame_size, len,
s->buffer_index);
if (len <= s->buffer_index) {
- if ((ret = ff_alloc_packet2(avctx, avpkt, len)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, len)) < 0)
return ret;
memcpy(avpkt->data, s->buffer, len);
s->buffer_index -= len;
s->enc_bitrate = avctx->bit_rate;
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, 32)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 32)) < 0)
return ret;
if (frame) {
/* write output if all frames for the packet have been encoded */
if (s->pkt_frame_count == s->frames_per_packet) {
s->pkt_frame_count = 0;
- if ((ret = ff_alloc_packet2(avctx, avpkt, speex_bits_nbytes(&s->bits))))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, speex_bits_nbytes(&s->bits))) < 0)
return ret;
ret = speex_bits_write(&s->bits, avpkt->data, avpkt->size);
speex_bits_reset(&s->bits);
TWOLAMEContext *s = avctx->priv_data;
int ret;
- if ((ret = ff_alloc_packet2(avctx, avpkt, MPA_MAX_CODED_FRAME_SIZE)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, MPA_MAX_CODED_FRAME_SIZE)) < 0)
return ret;
if (frame) {
return ret;
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, FFMAX(8192, 768 * avctx->channels))))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, FFMAX(8192, 768 * avctx->channels))) < 0)
return ret;
input.Buffer = samples;
const int16_t *samples = (const int16_t *)frame->data[0];
int size, ret;
- if ((ret = ff_alloc_packet2(avctx, avpkt, MAX_PACKET_SIZE)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, MAX_PACKET_SIZE)) < 0)
return ret;
if (s->last_bitrate != avctx->bit_rate) {
av_fifo_generic_read(s->pkt_fifo, &op, sizeof(ogg_packet), NULL);
- if ((ret = ff_alloc_packet2(avctx, avpkt, op.bytes)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, op.bytes)) < 0)
return ret;
av_fifo_generic_read(s->pkt_fifo, avpkt->data, op.bytes, NULL);
}
compute_bit_allocation(s, smr, bit_alloc, &padding);
- if ((ret = ff_alloc_packet2(avctx, avpkt, MPA_MAX_CODED_FRAME_SIZE)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, MPA_MAX_CODED_FRAME_SIZE)) < 0)
return ret;
init_put_bits(&s->pb, avpkt->data, avpkt->size);
s->last_frame = 1;
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, NELLY_BLOCK_LEN)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, NELLY_BLOCK_LEN)) < 0)
return ret;
encode_block(s, avpkt->data, avpkt->size);
n = frame->nb_samples * avctx->channels;
samples = (const short *)frame->data[0];
- if ((ret = ff_alloc_packet2(avctx, avpkt, n * sample_size)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, n * sample_size)) < 0)
return ret;
dst = avpkt->data;
if (ractx->last_frame)
return 0;
- if ((ret = ff_alloc_packet2(avctx, avpkt, FRAMESIZE)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, FRAMESIZE)) < 0)
return ret;
/**
else
data_size = avctx->channels * avctx->frame_size;
- if ((ret = ff_alloc_packet2(avctx, avpkt, ROQ_HEADER_SIZE + data_size)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, ROQ_HEADER_SIZE + data_size)) < 0)
return ret;
out = avpkt->data;
int ret;
const short *samples = (const int16_t*)frame->data[0];
- if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size * 5 + 1000)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, s->frame_size * 5 + 1000)) < 0)
return ret;
init_put_bits(&pb, avpkt->data, avpkt->size);
return 0;
samples = 1 << (venc->log2_blocksize[0] - 1);
- if ((ret = ff_alloc_packet2(avctx, avpkt, 8192)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 8192)) < 0)
return ret;
init_put_bits(&pb, avpkt->data, avpkt->size);
}
}
- if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * MAX_CODED_SUPERFRAME_SIZE)))
+ if ((ret = ff_alloc_packet2(avctx, avpkt, 2 * MAX_CODED_SUPERFRAME_SIZE)) < 0)
return ret;
total_gain= 128;