]> git.sesse.net Git - vlc/blobdiff - modules/codec/dmo/buffer.c
threads: Make sure we don't re-create a thread if the object has already one.
[vlc] / modules / codec / dmo / buffer.c
index 8cf3f8cada32bb4421e9533f5fa874ce990be5d7..321709df219adb552a9ec4c0ce392b698c022a55 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * buffer.c : DirectMedia Object decoder module for vlc
  *****************************************************************************
- * Copyright (C) 2002, 2003 VideoLAN
+ * Copyright (C) 2002, 2003 the VideoLAN team
  * $Id$
  *
  * Author: Gildas Bazin <gbazin@videolan.org>
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
 
-#include <vlc/vlc.h>
-#include <vlc/decoder.h>
-#include <vlc/vout.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include <objbase.h>
-#include "codecs.h"
+#include <vlc_common.h>
+#include <vlc_codec.h>
+#include <vlc_vout.h>
+
+#ifndef WIN32
+#    define LOADER
+#else
+#   include <objbase.h>
+#endif
+
+#ifdef LOADER
+#   include <wine/winerror.h>
+#   include <wine/windef.h>
+#endif
+
+#include <vlc_codecs.h>
 #include "dmo.h"
 
 static long STDCALL QueryInterface( IUnknown *This,
@@ -78,7 +89,7 @@ static long STDCALL Release( IUnknown *This )
 static long STDCALL SetLength( IMediaBuffer *This, uint32_t cbLength )
 {
     CMediaBuffer *p_mb = (CMediaBuffer *)This;
-    if( cbLength > p_mb->i_max_size ) return E_INVALIDARG;
+    if( cbLength > (uint32_t)p_mb->i_max_size ) return E_INVALIDARG;
     p_mb->p_block->i_buffer = cbLength;
     return S_OK;
 }
@@ -97,13 +108,13 @@ static long STDCALL GetBufferAndLength( IMediaBuffer *This,
     CMediaBuffer *p_mb = (CMediaBuffer *)This;
 
     if( !ppBuffer && !pcbLength ) return E_POINTER;
-    if( ppBuffer ) *ppBuffer = p_mb->p_block->p_buffer;
+    if( ppBuffer ) *ppBuffer = (char*)p_mb->p_block->p_buffer;
     if( pcbLength ) *pcbLength = p_mb->p_block->i_buffer;
     return S_OK;
 }
 
 CMediaBuffer *CMediaBufferCreate( block_t *p_block, int i_max_size,
-                                  vlc_bool_t b_own )
+                                  bool b_own )
 {
     CMediaBuffer *p_mb = (CMediaBuffer *)malloc( sizeof(CMediaBuffer) );
     if( !p_mb ) return NULL;