Merge remote-tracking branch 'qatar/master'
* qatar/master: (34 commits) mlp_parser: fix the channel mask value used for the top surround channel vorbisenc: check all allocations for failure roqaudioenc: return AVERROR codes instead of -1 roqaudioenc: set correct bit rate roqaudioenc: use AVCodecContext.frame_size correctly. roqaudioenc: remove unneeded sample_fmt check ra144enc: use int16_t* for input samples rather than void* ra144enc: set AVCodecContext.coded_frame ra144enc: remove unneeded sample_fmt check nellymoserenc: set AVCodecContext.coded_frame nellymoserenc: improve error checking in encode_init() nellymoserenc: return AVERROR codes instead of -1 libvorbis: improve error checking in oggvorbis_encode_init() mpegaudioenc: return AVERROR codes instead of -1 libfaac: improve error checking and handling in Faac_encode_init() avutil: add AVERROR_UNKNOWN check for coded_frame allocation failure in several audio encoders audio encoders: do not set coded_frame->key_frame. g722enc: check for trellis data allocation error libspeexenc: export encoder delay through AVCodecContext.delay ... Conflicts: doc/APIchanges libavcodec/avcodec.h libavcodec/fraps.c libavcodec/kgv1dec.c libavcodec/libfaac.c libavcodec/libgsm.c libavcodec/libvorbis.c libavcodec/mlp_parser.c libavcodec/roqaudioenc.c libavcodec/vorbisenc.c libavutil/avutil.h libavutil/error.c libavutil/error.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -603,6 +603,8 @@ int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic){
|
||||
return s->get_buffer(s, pic);
|
||||
}
|
||||
|
||||
assert(s->pix_fmt == pic->pix_fmt);
|
||||
|
||||
/* If internal buffer type return the same buffer */
|
||||
if(pic->type == FF_BUFFER_TYPE_INTERNAL) {
|
||||
return 0;
|
||||
@@ -967,6 +969,8 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
||||
int user_packet = !!avpkt->data;
|
||||
int nb_samples;
|
||||
|
||||
*got_packet_ptr = 0;
|
||||
|
||||
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
|
||||
av_init_packet(avpkt);
|
||||
avpkt->size = 0;
|
||||
@@ -988,7 +992,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
if (avctx->codec->encode2) {
|
||||
*got_packet_ptr = 0;
|
||||
ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
|
||||
if (!ret && *got_packet_ptr) {
|
||||
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY)) {
|
||||
@@ -1196,10 +1199,11 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
|
||||
int ret;
|
||||
int user_packet = !!avpkt->data;
|
||||
|
||||
*got_packet_ptr = 0;
|
||||
|
||||
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
|
||||
av_init_packet(avpkt);
|
||||
avpkt->size = 0;
|
||||
*got_packet_ptr = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1208,17 +1212,15 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
|
||||
|
||||
av_assert0(avctx->codec->encode2);
|
||||
|
||||
*got_packet_ptr = 0;
|
||||
ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr);
|
||||
if (!ret) {
|
||||
if (!*got_packet_ptr)
|
||||
avpkt->size = 0;
|
||||
else if (!(avctx->codec->capabilities & CODEC_CAP_DELAY))
|
||||
avpkt->pts = avpkt->dts = frame->pts;
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
avctx->frame_number++;
|
||||
}
|
||||
|
||||
emms_c();
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user