Module: libav
Branch: master
Commit: 31048d48b0410b9cfb6023054d81e627d01be342

Author:    Michael Niedermayer <[email protected]>
Committer: Derek Buitenhuis <[email protected]>
Date:      Tue Mar 31 00:37:46 2015 +0200

avcodec/libx265: export chosen picture types

Signed-off-by: Michael Niedermayer <[email protected]>
Signed-off-by: Derek Buitenhuis <[email protected]>

---

 libavcodec/libx265.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index d822467..a7089b1 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;
 }

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to