mirror of https://github.com/mpv-player/mpv
Switch to avcodec_decode_video2 to allow a hack that makes PNG decode correctly
again instead of in CorePNG delta mode. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29340 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
31f9de2546
commit
d90d9d3d22
|
@ -758,6 +758,7 @@ static mp_image_t *decode(sh_video_t *sh, void *data, int len, int flags){
|
||||||
AVCodecContext *avctx = ctx->avctx;
|
AVCodecContext *avctx = ctx->avctx;
|
||||||
mp_image_t *mpi=NULL;
|
mp_image_t *mpi=NULL;
|
||||||
int dr1= ctx->do_dr1;
|
int dr1= ctx->do_dr1;
|
||||||
|
AVPacket pkt;
|
||||||
|
|
||||||
if(len<=0) return NULL; // skipped frame
|
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",
|
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]);
|
((int *)data)[0], ((int *)data)[1], ((int *)data)[2], ((int *)data)[3]);
|
||||||
ret = avcodec_decode_video(avctx, pic,
|
av_init_packet(&pkt);
|
||||||
&got_picture, data, len);
|
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;
|
dr1= ctx->do_dr1;
|
||||||
if(ret<0) mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Error while decoding frame!\n");
|
if(ret<0) mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Error while decoding frame!\n");
|
||||||
|
|
Loading…
Reference in New Issue