diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 12:33:27 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 12:33:27 +0100 |
commit | a0c0629dd963b00f989172f0c599353b6b288c37 (patch) | |
tree | 9948f38dd870d440db9ac10f98bbf1275282b056 /libavcodec/libxavs.c | |
parent | 5b0c70c2499e20529d517b712910d6f4f72e9485 (diff) | |
parent | 97168b204a0b6b79bb6c5f0d40efdf7fc2262476 (diff) | |
download | ffmpeg-a0c0629dd963b00f989172f0c599353b6b288c37.tar.gz |
Merge commit '97168b204a0b6b79bb6c5f0d40efdf7fc2262476'
* commit '97168b204a0b6b79bb6c5f0d40efdf7fc2262476':
eatgv: use the AVFrame API properly.
libxavs: use the AVFrame API properly.
nuv: use the AVFrame API properly.
flashsvenc: use the AVFrame API properly.
Conflicts:
libavcodec/eatgv.c
libavcodec/nuv.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libxavs.c')
-rw-r--r-- | libavcodec/libxavs.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index f7b99e0bcd..1b72194573 100644 --- a/libavcodec/libxavs.c +++ b/libavcodec/libxavs.c @@ -45,7 +45,6 @@ typedef struct XavsContext { xavs_picture_t pic; uint8_t *sei; int sei_size; - AVFrame out_pic; int end_of_stream; float crf; int cqp; @@ -159,7 +158,7 @@ static int XAVS_frame(AVCodecContext *ctx, AVPacket *pkt, return 0; } - x4->out_pic.pts = pic_out.i_pts; + avctx->coded_frame->pts = pic_out.i_pts; pkt->pts = pic_out.i_pts; if (ctx->has_b_frames) { if (!x4->out_frame_count) @@ -172,25 +171,25 @@ static int XAVS_frame(AVCodecContext *ctx, AVPacket *pkt, switch (pic_out.i_type) { case XAVS_TYPE_IDR: case XAVS_TYPE_I: - x4->out_pic.pict_type = AV_PICTURE_TYPE_I; + avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; break; case XAVS_TYPE_P: - x4->out_pic.pict_type = AV_PICTURE_TYPE_P; + avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P; break; case XAVS_TYPE_B: case XAVS_TYPE_BREF: - x4->out_pic.pict_type = AV_PICTURE_TYPE_B; + avctx->coded_frame->pict_type = AV_PICTURE_TYPE_B; break; } /* There is no IDR frame in AVS JiZhun */ /* Sequence header is used as a flag */ if (pic_out.i_type == XAVS_TYPE_I) { - x4->out_pic.key_frame = 1; + avctx->coded_frame->key_frame = 1; pkt->flags |= AV_PKT_FLAG_KEY; } - x4->out_pic.quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA; + avctx->coded_frame->quality = (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA; x4->out_frame_count++; *got_packet = ret; @@ -208,6 +207,8 @@ static av_cold int XAVS_close(AVCodecContext *avctx) if (x4->enc) xavs_encoder_close(x4->enc); + av_frame_free(&avctx->coded_frame); + return 0; } @@ -355,7 +356,10 @@ static av_cold int XAVS_init(AVCodecContext *avctx) if (!(x4->pts_buffer = av_mallocz((avctx->max_b_frames+1) * sizeof(*x4->pts_buffer)))) return AVERROR(ENOMEM); - avctx->coded_frame = &x4->out_pic; + avctx->coded_frame = av_frame_alloc(); + if (!avctx->coded_frame) + return AVERROR(ENOMEM); + /* TAG: Do we have GLOBAL HEADER in AVS */ /* We Have PPS and SPS in AVS */ if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) { |