summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-07-07 02:56:01 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-07-07 02:56:01 +0300
commita2037a2effbd4622d0e8336245a9b14c3f886bde (patch)
treebd2face6dd36d2663197b23a33da9e9b2814f70c /libmpcodecs/vd_ffmpeg.c
parent0c2773a709276681575d2507aa60ee85c2d0b850 (diff)
parent43079c51daa8c12b0a44e5ad8022c979dd9e8336 (diff)
downloadmpv-a2037a2effbd4622d0e8336245a9b14c3f886bde.tar.bz2
mpv-a2037a2effbd4622d0e8336245a9b14c3f886bde.tar.xz
Merge svn changes up to r29412
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 78d3eb5b7a..4cf20037e9 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -749,6 +749,7 @@ static mp_image_t *decode(sh_video_t *sh, void *data, int len, int flags){
struct lavc_param *lavc_param = &sh->opts->lavc_param;
mp_image_t *mpi=NULL;
int dr1= ctx->do_dr1;
+ AVPacket pkt;
if(len<=0) return NULL; // skipped frame
@@ -769,8 +770,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");