summaryrefslogtreecommitdiff
path: root/modules/h265
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-07-19 19:41:40 +0200
committerAlfred E. Heggestad <aeh@db.org>2016-07-19 19:41:40 +0200
commit73d7f194d3a1e5dee2ef23c0b6ccb6605d2eddb2 (patch)
treec28bb1f324e90262014665b157c9c3f8509a39ab /modules/h265
parent9e1bd7e0e86923636353da256b2086225453a1af (diff)
avcodec_decode_video2 is deprecated
Diffstat (limited to 'modules/h265')
-rw-r--r--modules/h265/decode.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/h265/decode.c b/modules/h265/decode.c
index 6dc1cc6..d14a99d 100644
--- a/modules/h265/decode.c
+++ b/modules/h265/decode.c
@@ -263,12 +263,30 @@ int h265_decode(struct viddec_state *vds, struct vidframe *frame,
avpkt.data = vds->mb->buf;
avpkt.size = (int)vds->mb->end;
+#if LIBAVCODEC_VERSION_INT >= ((57<<16)+(37<<8)+100)
+
+ ret = avcodec_send_packet(vds->ctx, &avpkt);
+ if (ret < 0) {
+ err = EBADMSG;
+ goto out;
+ }
+
+ ret = avcodec_receive_frame(vds->ctx, vds->pict);
+ if (ret < 0) {
+ err = EBADMSG;
+ goto out;
+ }
+
+ got_picture = true;
+
+#else
ret = avcodec_decode_video2(vds->ctx, vds->pict, &got_picture, &avpkt);
if (ret < 0) {
debug("h265: decode error\n");
err = EPROTO;
goto out;
}
+#endif
if (!got_picture) {
/* debug("h265: no picture\n"); */