Permalink
Browse files

No more exception if XvQueryPortAttributes fails

Apparently recent versions of X.Org do not support XvQueryPortAttributes
any more.
  • Loading branch information...
1 parent ec0bfe0 commit bffaf52d845c20d2e2a6ba72a2787c1cce612272 @wedesoft committed May 27, 2012
Showing with 10 additions and 10 deletions.
  1. +1 −1 Rakefile
  2. +9 −9 ext/xvwidget.cc
View
@@ -7,7 +7,7 @@ require 'rake/loaders/makefile'
require 'rbconfig'
PKG_NAME = 'hornetseye-qt4'
-PKG_VERSION = '0.2.0'
+PKG_VERSION = '0.2.1'
CFG = RbConfig::CONFIG
CXX = ENV[ 'CXX' ] || 'g++'
RB_FILES = FileList[ 'lib/**/*.rb' ]
View
@@ -297,17 +297,17 @@ Atom XvManager::findAtom( Display *display, const char *name ) throw (Error)
assert( m_port != 0 );
XvAttribute *attributes;
int numAttributes;
+ Atom retVal = None;
attributes = XvQueryPortAttributes( display, m_port,
&numAttributes );
- ERRORMACRO( attributes != NULL, Error, ,
- "Error requesting attributes of X video port." );
- Atom retVal = None;
- for ( int i=0; i<numAttributes; i++ )
- if ( strcmp( attributes[i].name, name ) == 0 ) {
- retVal = XInternAtom( display, name, False );
- break;
- }
- XFree( attributes );
+ if (attributes != NULL) {
+ for ( int i=0; i<numAttributes; i++ )
+ if ( strcmp( attributes[i].name, name ) == 0 ) {
+ retVal = XInternAtom( display, name, False );
+ break;
+ }
+ XFree( attributes );
+ }
return retVal;
}

0 comments on commit bffaf52

Please sign in to comment.