aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libxavs.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-22 19:52:04 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-22 19:52:04 +0200
commit557e011bf16758a7379afc584cb0b1f5f64b30ed (patch)
tree964825c662a3d2a9a87d7abb22aa08f13da0337c /libavcodec/libxavs.c
parentc40ecffd31d0e0be531425e48a98c1a8fcaaffa2 (diff)
downloadffmpeg-557e011bf16758a7379afc584cb0b1f5f64b30ed.tar.gz
avcodec/libxavs: Export pict_type in side data
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/libxavs.c')
-rw-r--r--libavcodec/libxavs.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c
index 9c1c6897d0..69bc83af87 100644
--- a/libavcodec/libxavs.c
+++ b/libavcodec/libxavs.c
@@ -118,6 +118,7 @@ static int XAVS_frame(AVCodecContext *avctx, AVPacket *pkt,
int nnal, i, ret;
xavs_picture_t pic_out;
uint8_t *sd;
+ int pict_type;
x4->pic.img.i_csp = XAVS_CSP_I420;
x4->pic.img.i_plane = 3;
@@ -173,21 +174,24 @@ FF_ENABLE_DEPRECATION_WARNINGS
} else
pkt->dts = pkt->pts;
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
switch (pic_out.i_type) {
case XAVS_TYPE_IDR:
case XAVS_TYPE_I:
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+ pict_type = AV_PICTURE_TYPE_I;
break;
case XAVS_TYPE_P:
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
+ pict_type = AV_PICTURE_TYPE_P;
break;
case XAVS_TYPE_B:
case XAVS_TYPE_BREF:
- avctx->coded_frame->pict_type = AV_PICTURE_TYPE_B;
+ pict_type = AV_PICTURE_TYPE_B;
break;
+ default:
+ pict_type = AV_PICTURE_TYPE_NONE;
}
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+ avctx->coded_frame->pict_type = pict_type;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
@@ -208,7 +212,7 @@ FF_DISABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
#endif
- ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, 0);
+ ff_side_data_set_encoder_stats(pkt, (pic_out.i_qpplus1 - 1) * FF_QP2LAMBDA, NULL, 0, pict_type);
x4->out_frame_count++;
*got_packet = ret;