From 0248741426b6a1f2079cc4ae4b70916412fb1e23 Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 18 Feb 2009 07:52:17 +0000 Subject: Handle mpcodecs_get_image returning NULL, FFmpeg most of the time handles it correctly (VDPAU and probably H.264 currently don't, MPEG1/2 does etc.). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28643 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libmpcodecs') diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index d8a7060434..9a0b9482d6 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -576,6 +576,7 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *pic){ mpi= mpcodecs_get_image(sh, type, flags, (width+align)&(~align), (height+align)&(~align)); + if (!mpi) return -1; // ok, let's see what did we get: if(mpi->flags&MP_IMGFLAG_DRAW_CALLBACK && -- cgit v1.2.3 From 60fa5a134d34c694158c94513dce85f855984b0e Mon Sep 17 00:00:00 2001 From: reimar Date: Wed, 18 Feb 2009 12:30:15 +0000 Subject: Add VOCAP_NOSLICES and use it to allow vo_vdpau to not support slices for YV12 - since VDPAU only has functions to upload the full frame at once there is no sense in supporting draw_slice for that. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28646 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_vo.c | 2 ++ libmpcodecs/vfcap.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'libmpcodecs') diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c index 4e0f1374c1..affffa6bde 100644 --- a/libmpcodecs/vf_vo.c +++ b/libmpcodecs/vf_vo.c @@ -32,6 +32,7 @@ struct vf_priv_s { #define video_out (vf->priv->vo) static int query_format(struct vf_instance_s* vf, unsigned int fmt); /* forward declaration */ +static void draw_slice(struct vf_instance_s* vf, unsigned char** src, int* stride, int w,int h, int x, int y); static int config(struct vf_instance_s* vf, int width, int height, int d_width, int d_height, @@ -61,6 +62,7 @@ static int config(struct vf_instance_s* vf, // save vo's stride capability for the wanted colorspace: vf->default_caps=query_format(vf,outfmt); + vf->draw_slice = (vf->default_caps & VOCAP_NOSLICES) ? NULL : draw_slice; if(config_video_out(video_out,width,height,d_width,d_height,flags,"MPlayer",outfmt)) return 0; diff --git a/libmpcodecs/vfcap.h b/libmpcodecs/vfcap.h index 9745a5c9bd..158928d924 100644 --- a/libmpcodecs/vfcap.h +++ b/libmpcodecs/vfcap.h @@ -33,5 +33,7 @@ #define VFCAP_EOSD 0x2000 // filter will draw EOSD at screen resolution (without scaling) #define VFCAP_EOSD_UNSCALED 0x4000 +// used by libvo and vf_vo, indicates the VO does not support draw_slice for this format +#define VOCAP_NOSLICES 0x8000 #endif /* MPLAYER_VFCAP_H */ -- cgit v1.2.3