summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r--libmpcodecs/vd_ffmpeg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index f499e8e424..244e6495b3 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -758,6 +758,7 @@ static mp_image_t *decode(sh_video_t *sh, void *data, int len, int flags){
AVCodecContext *avctx = ctx->avctx;
mp_image_t *mpi=NULL;
int dr1= ctx->do_dr1;
+ AVPacket pkt;
if(len<=0) return NULL; // skipped frame
@@ -778,8 +779,12 @@ static mp_image_t *decode(sh_video_t *sh, void *data, int len, int flags){
mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "vd_ffmpeg data: %04x, %04x, %04x, %04x\n",
((int *)data)[0], ((int *)data)[1], ((int *)data)[2], ((int *)data)[3]);
- ret = avcodec_decode_video(avctx, pic,
- &got_picture, data, len);
+ av_init_packet(&pkt);
+ pkt.data = data;
+ pkt.size = len;
+ // HACK: make PNGs decode normally instead of as CorePNG delta frames
+ pkt.flags = PKT_FLAG_KEY;
+ ret = avcodec_decode_video2(avctx, pic, &got_picture, &pkt);
dr1= ctx->do_dr1;
if(ret<0) mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Error while decoding frame!\n");