1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec: refactor avcodec_encode_audio2() to merge common branches

This commit is contained in:
Justin Ruggles 2012-03-21 15:36:25 -04:00
parent b461cd4deb
commit fa0319b4fd

View File

@ -885,8 +885,9 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
} }
} }
ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr); ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
if (!ret && *got_packet_ptr) { if (!ret) {
if (*got_packet_ptr) {
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) { if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) {
if (avpkt->pts == AV_NOPTS_VALUE) if (avpkt->pts == AV_NOPTS_VALUE)
avpkt->pts = frame->pts; avpkt->pts = frame->pts;
@ -899,7 +900,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
avpkt->size = 0; avpkt->size = 0;
} }
if (!ret) {
if (!user_packet && avpkt->size) { if (!user_packet && avpkt->size) {
uint8_t *new_data = av_realloc(avpkt->data, avpkt->size); uint8_t *new_data = av_realloc(avpkt->data, avpkt->size);
if (new_data) if (new_data)