diff libmpcodecs/ad_qtaudio.c @ 9502:241bba8f60e8

MACOSX support patch, based on Dan Christiansens work
author alex
date Tue, 25 Feb 2003 15:39:36 +0000
parents a4444e7ee56a
children 43c6bc4e7e2f
line wrap: on
line diff
--- a/libmpcodecs/ad_qtaudio.c	Tue Feb 25 08:22:00 2003 +0000
+++ b/libmpcodecs/ad_qtaudio.c	Tue Feb 25 15:39:36 2003 +0000
@@ -5,7 +5,7 @@
 
 #include "config.h"
 
-#ifdef USE_QTX_CODECS
+#if defined(USE_QTX_CODECS) || defined(MACOSX)
 
 #include "ad_internal.h"
 #include "bswap.h"
@@ -14,6 +14,10 @@
 #include "ldt_keeper.h"
 #endif
 
+#ifdef MACOSX
+#include <QuickTime/QuickTimeComponents.h>
+#endif
+
 static ad_info_t info =  {
 	"QuickTime Audio Decoder",
 	"qtaudio",
@@ -24,6 +28,7 @@
 
 LIBAD_EXTERN(qtaudio)
 
+#ifdef USE_QTX_CODECS
 typedef struct OpaqueSoundConverter*    SoundConverter;
 typedef unsigned long                   OSType;
 typedef unsigned long                   UnsignedFixed;
@@ -150,6 +155,7 @@
     printf("loader_init DONE???\n");
 	return 0;
 }
+#endif /* USE_QTX_CODECS */
 
 static SoundConverter			   myConverter = NULL;
 static SoundComponentData		   InputFormatInfo,OutputFormatInfo;
@@ -166,7 +172,11 @@
 
     printf("win32 libquicktime loader (c) Sascha Sommer\n");
 
+#ifdef MACOSX
+    EnterMovies();
+#else
     if(loader_init()) return 0; // failed to load DLL
+#endif
     
     printf("loader_init DONE!\n");
 
@@ -258,6 +268,9 @@
 //    FreeLibrary( qtml_dll );
 //    qtml_dll = NULL;
 //    printf("qt dll loader uninit done\n");
+#ifdef MACOSX
+    ExitMovies();
+#endif
 }
 
 static int decode_audio(sh_audio_t *sh,unsigned char *buf,int minlen,int maxlen){