]> git.sesse.net Git - vlc/blobdiff - plugins/yuv/video_yuvmmx.c
Rewritten vout for BeOS. Now does not support overlay however code is simpler
[vlc] / plugins / yuv / video_yuvmmx.c
index 782c3e361c6d76df39a9a94e0b6d7ac05ee928e5..e4ddf9dbbc770aff681ee8d71ee69615278e0c27 100644 (file)
@@ -3,7 +3,7 @@
  * Provides functions to perform the YUV conversion.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_yuvmmx.c,v 1.9 2001/05/15 16:19:42 sam Exp $
+ * $Id: video_yuvmmx.c,v 1.12 2001/08/03 16:04:17 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -42,8 +42,6 @@
 #include "mtime.h"
 #include "tests.h"
 
-#include "modules.h"
-
 #include "video.h"
 #include "video_output.h"
 
@@ -51,6 +49,9 @@
 
 #include "intf_msg.h"
 
+#include "modules.h"
+#include "modules_export.h"
+
 static int     yuv_Probe      ( probedata_t *p_data );
 static int     yuv_Init       ( vout_thread_t *p_vout );
 static int     yuv_Reset      ( vout_thread_t *p_vout );
@@ -84,7 +85,8 @@ static int yuv_Probe( probedata_t *p_data )
         return( 0 );
     }
 
-    if( TestMethod( YUV_METHOD_VAR, "yuvmmx" ) )
+    if( TestMethod( YUV_METHOD_VAR, "yuvmmx" )
+         || TestMethod( YUV_METHOD_VAR, "mmx" ) )
     {
         return( 999 );
     }
@@ -126,14 +128,16 @@ static int yuv_Init( vout_thread_t *p_vout )
     if( p_vout->yuv.p_buffer == NULL )
     {
         intf_ErrMsg("error: %s", strerror(ENOMEM));
-        free( p_vout->yuv.p_base );
+        if( p_vout->yuv.p_base )
+            free( p_vout->yuv.p_base );
         return( 1 );
     }
     p_vout->yuv.p_offset = malloc( p_vout->i_width * sizeof( int ) );
     if( p_vout->yuv.p_offset == NULL )
     {
         intf_ErrMsg("error: %s", strerror(ENOMEM));
-        free( p_vout->yuv.p_base );
+        if( p_vout->yuv.p_base )
+            free( p_vout->yuv.p_base );
         free( p_vout->yuv.p_buffer );
         return( 1 );
     }
@@ -150,7 +154,8 @@ static int yuv_Init( vout_thread_t *p_vout )
  *****************************************************************************/
 static void yuv_End( vout_thread_t *p_vout )
 {
-    free( p_vout->yuv.p_base );
+    if( p_vout->yuv.p_base )
+        free( p_vout->yuv.p_base );
     free( p_vout->yuv.p_buffer );
     free( p_vout->yuv.p_offset );
 }