]> git.sesse.net Git - vlc/blobdiff - modules/codec/xvmc/xxmc.c
Merge branch 1.0-bugfix
[vlc] / modules / codec / xvmc / xxmc.c
index 7b8a87a16aa2662e36176ef207cb7c8294cf78b5..19b238b9fb87d7450f4d1f82310a2b3e28664083 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include <vlc_vout.h>
 #include <vlc_codec.h>
 #include <vlc_codec_synchro.h>
 
@@ -121,17 +120,25 @@ static int OpenDecoder( vlc_object_t *p_this )
 #ifdef __GLIBC__
     mtrace();
 #endif
-    if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV &&
-        p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','1') &&
-        /* Pinnacle hardware-mpeg1 */
-        p_dec->fmt_in.i_codec != VLC_FOURCC('P','I','M','1') &&
-        /* VIA hardware-mpeg2 */
-        p_dec->fmt_in.i_codec != VLC_FOURCC('X','x','M','C') &&
-        /* ATI Video */
-        p_dec->fmt_in.i_codec != VLC_FOURCC('V','C','R','2') &&
-        p_dec->fmt_in.i_codec != VLC_FOURCC('m','p','g','2') )
-    {
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV )
         return VLC_EGENERIC;
+    /* Select onl recognized original format (standard mpeg video) */
+    switch( p_dec->fmt_in.i_original_fourcc )
+    {
+    case VLC_FOURCC('m','p','g','1'):
+    case VLC_FOURCC('m','p','g','2'):
+    case VLC_FOURCC('m','p','g','v'):
+    /* Pinnacle hardware-mpeg1 */
+    case VLC_FOURCC('P','I','M','1'):
+    /* VIA hardware-mpeg2 */
+    case VLC_FOURCC('X','x','M','C'):
+    /* ATI Video */
+    case VLC_FOURCC('V','C','R','2'):
+        break;
+    default:
+        if( p_dec->fmt_in.i_original_fourcc )
+            return VLC_EGENERIC;
+        break;
     }
 
     msg_Dbg(p_dec, "OpenDecoder Entering");