Permalink
Browse files

Rework renderer selection to only allow one match per round

Pointed out by coverty detecting a potential leak.
  • Loading branch information...
dekarl committed May 25, 2013
1 parent 423e866 commit b745004476c86bcbde160a08dccdf4d448397730
Showing with 14 additions and 11 deletions.
  1. +14 −11 mythtv/libs/libmythtv/videooutbase.cpp
@@ -213,44 +213,47 @@ VideoOutput *VideoOutput::Create(
VideoOutput *vo = NULL;
/* these cases are mutually exlusive */
if (renderer == "null")
vo = new VideoOutputNull();
#ifdef USING_MINGW
if (renderer == "direct3d")
else if (renderer == "direct3d")
vo = new VideoOutputD3D();
#endif // USING_MINGW
#ifdef USING_QUARTZ_VIDEO
if (osxlist.contains(renderer))
else if (osxlist.contains(renderer))
vo = new VideoOutputQuartz();
#endif // Q_OS_MACX
#ifdef USING_OPENGL_VIDEO
if (renderer.contains("opengl"))
else if (renderer.contains("opengl") && (renderer != "openglvaapi"))
vo = new VideoOutputOpenGL(renderer);
#endif // USING_OPENGL_VIDEO
#ifdef USING_VDPAU
if (renderer == "vdpau")
else if (renderer == "vdpau")
vo = new VideoOutputVDPAU();
if (renderer == "nullvdpau")
else if (renderer == "nullvdpau")
vo = new VideoOutputNullVDPAU();
#endif // USING_VDPAU
#ifdef USING_VAAPI
if (renderer == "nullvaapi")
else if (renderer == "nullvaapi")
vo = new VideoOutputNullVAAPI();
#endif // USING_VAAPI
#ifdef USING_GLVAAPI
if (renderer == "openglvaapi")
else if (renderer == "openglvaapi")
vo = new VideoOutputOpenGLVAAPI();
#endif // USING_GLVAAPI
#ifdef USING_XV
if (xvlist.contains(renderer))
else if (xvlist.contains(renderer))
vo = new VideoOutputXv();
#endif // USING_XV
if (renderer == "null")
vo = new VideoOutputNull();
if (vo && !(playerFlags & kVideoIsNull))
{
// ensure we have a window to display into

0 comments on commit b745004

Please sign in to comment.