summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-17 16:40:50 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-17 16:40:50 +0000
commit8e5edec13eabc42923bc119f435566145955c124 (patch)
tree5633a76fe839c235408c724cad038ceb7cf33837 /libmpcodecs
parent78d1037cd9d172ad28227261df821e8109deaa3e (diff)
downloadmpv-8e5edec13eabc42923bc119f435566145955c124.tar.bz2
mpv-8e5edec13eabc42923bc119f435566145955c124.tar.xz
Set avctx->opaque already at init instead of decode so it can be used in
get_format and get_buffer would not crash if called during avcodec_open. Patch by Gwenole Beauchesne [gbeauchesne splitted-desktop com] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28636 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_ffmpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index abff4aff7f..d8a7060434 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -240,6 +240,7 @@ static int init(sh_video_t *sh){
ctx->pic = avcodec_alloc_frame();
ctx->avctx = avcodec_alloc_context();
avctx = ctx->avctx;
+ avctx->opaque = sh;
#if CONFIG_VDPAU
if(lavc_codec->capabilities & CODEC_CAP_HWACCEL_VDPAU){
@@ -744,7 +745,6 @@ static mp_image_t *decode(sh_video_t *sh, void *data, int len, int flags){
//ffmpeg interlace (mpeg2) bug have been fixed. no need of -noslices
if (!dr1)
avctx->draw_horiz_band=NULL;
- avctx->opaque=sh;
if(ctx->vo_initialized && !(flags&3) && !dr1){
mpi=mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE |
(ctx->do_slices?MP_IMGFLAG_DRAW_CALLBACK:0),