summaryrefslogtreecommitdiff
path: root/libavcodec/libx265.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-31 00:37:46 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-03-31 20:21:10 +0200
commit2ddedfd39c0d6b49e6396c535d5cb21846676a13 (patch)
tree8a845e7ecc10b7f143d67d30383ef93547d702e0 /libavcodec/libx265.c
parent749fbfd0817528aa4f43339ce1a3d92f0a258a45 (diff)
avcodec/libx265: export choosen picture types
Fixes part of ticket 4285 Reviewed-by Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libx265.c')
-rw-r--r--libavcodec/libx265.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 5a26ca997c..19217b0208 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -272,6 +272,19 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
pkt->pts = x265pic_out.pts;
pkt->dts = x265pic_out.dts;
+ switch (x265pic_out.sliceType) {
+ case X265_TYPE_IDR:
+ case X265_TYPE_I:
+ avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+ break;
+ case X265_TYPE_P:
+ avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
+ break;
+ case X265_TYPE_B:
+ avctx->coded_frame->pict_type = AV_PICTURE_TYPE_B;
+ break;
+ }
+
*got_packet = 1;
return 0;
}