summaryrefslogtreecommitdiffstats
path: root/libvo/mga_common.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-06-04 08:10:48 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-06-04 08:10:48 +0300
commitd5c868325cefcd5fad53361d1dfdc9757674eb70 (patch)
treea838e509fdc2468220466e6337097b3ef590b00c /libvo/mga_common.c
parent0cb5123c8f65b3d7715deb22ce8430eccc21996e (diff)
parent5b3834c5d1033f05d798278c33782c5563247062 (diff)
downloadmpv-d5c868325cefcd5fad53361d1dfdc9757674eb70.tar.bz2
mpv-d5c868325cefcd5fad53361d1dfdc9757674eb70.tar.xz
Merge svn changes up to r26979
Most of the conflicts are trivial. Conflicts: Makefile cfg-mplayer.h input/input.c libmenu/vf_menu.c libmpcodecs/dec_video.c libmpcodecs/vf_expand.c libmpcodecs/vf_vo.c libmpdemux/demux_mkv.c libmpdemux/demuxer.c libmpdemux/demuxer.h libvo/vo_directfb2.c libvo/vo_gl.c libvo/vo_winvidix.c libvo/vo_xv.c libvo/vo_xvidix.c libvo/vo_xvmc.c libvo/x11_common.c mplayer.c osdep/timer-linux.c stream/cache2.c
Diffstat (limited to 'libvo/mga_common.c')
-rw-r--r--libvo/mga_common.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/libvo/mga_common.c b/libvo/mga_common.c
index e90aebd764..acd7d88cd2 100644
--- a/libvo/mga_common.c
+++ b/libvo/mga_common.c
@@ -364,7 +364,7 @@ static int mga_init(int width,int height,unsigned int format){
mga_vid_config.format=MGA_VID_FORMAT_UYVY; break;
default:
mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_InvalidOutputFormat,format);
- return (-1);
+ return -1;
}
mga_vid_config.src_width = width;
@@ -382,7 +382,7 @@ static int mga_init(int width,int height,unsigned int format){
if(width > 1024 && height > 1024)
{
mp_msg(MSGT_VO,MSGL_ERR, MGSTR_LIBVO_MGA_ResolutionTooHigh);
- return (-1);
+ return -1;
} else if(height <= 1024)
{
// try whether we have a G550
@@ -393,7 +393,7 @@ static int mga_init(int width,int height,unsigned int format){
{
// we don't have a G550, so our resolution is too high
mp_msg(MSGT_VO,MSGL_ERR, MGSTR_LIBVO_MGA_ResolutionTooHigh);
- return (-1);
+ return -1;
} else {
// there is a deeper problem
// we have a G550, but still couldn't configure mga_vid
@@ -445,6 +445,7 @@ static int mga_uninit(){
static int preinit(const char *vo_subdevice)
{
+ uint32_t ver;
const char *devname=vo_subdevice?vo_subdevice:"/dev/mga_vid";
sws_rgb2rgb_init(get_sws_cpuflags());
@@ -453,7 +454,17 @@ static int preinit(const char *vo_subdevice)
{
perror("open");
mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_MGA_CouldntOpen,devname);
- return(-1);
+ return -1;
+ }
+
+ // check whether the mga_vid driver has the same
+ // version as we expect
+
+ ioctl(f,MGA_VID_GET_VERSION,&ver);
+ if(MGA_VID_VERSION != ver)
+ {
+ mp_msg(MSGT_VO, MSGL_ERR, MGSTR_LIBVO_MGA_mgavidVersionMismatch, ver, MGA_VID_VERSION);
+ return -1;
}
#ifdef VO_XMGA