[vlc-devel] commit: macosx: don't use mach_absolute_time() ( introduced in 5ead92ffd58088828ed802173d963b2571f0cd69) on PowerPC-based Macs as this breaks the playback of a certain set of AVI and WMV files ( Felix Paul Kühne )

git version control git at videolan.org
Mon Mar 23 14:19:34 CET 2009


vlc | branch: 0.9-bugfix | Felix Paul Kühne <fkuehne at videolan.org> | Mon Mar 23 14:19:30 2009 +0100| [49f3721c5baa88feece1d8793f08f08b2ed86a4d] | committer: Felix Paul Kühne 

macosx: don't use mach_absolute_time() (introduced in 5ead92ffd58088828ed802173d963b2571f0cd69) on PowerPC-based Macs as this breaks the playback of a certain set of AVI and WMV files

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=49f3721c5baa88feece1d8793f08f08b2ed86a4d
---

 include/vlc_threads.h |    4 ++--
 src/misc/mtime.c      |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index 8a21f84..4871fcd 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -359,7 +359,7 @@ static inline void __vlc_cond_wait( const char * psz_file, int i_line,
 #define vlc_cond_timedwait( P_COND, P_MUTEX, DEADLINE )                      \
     __vlc_cond_timedwait( __FILE__, __LINE__, P_COND, P_MUTEX, DEADLINE  )
 
-#ifdef __APPLE__
+#if defined(__APPLE__) && !defined(__powerpc__) 
 # include <sys/time.h> /* gettimeofday in vlc_cond_timedwait */
 #endif
 
@@ -369,7 +369,7 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
                                         mtime_t deadline )
 {
 #if defined(LIBVLC_USE_PTHREAD)
-#ifdef __APPLE__
+#if defined(__APPLE__) && !defined(__powerpc__)
     /* mdate() is mac_absolute_time on osx, which we must convert to do
      * the same base than gettimeofday() on which pthread_cond_timedwait
      * counts on. */
diff --git a/src/misc/mtime.c b/src/misc/mtime.c
index ed65f03..5792c9b 100644
--- a/src/misc/mtime.c
+++ b/src/misc/mtime.c
@@ -60,7 +60,7 @@
 #   include <sys/time.h>
 #endif
 
-#ifdef __APPLE__
+#if defined(__APPLE__) && !defined(__powerpc__)
 #   include <mach/mach.h>
 #   include <mach/mach_time.h>
 #endif
@@ -177,7 +177,7 @@ static inline unsigned mprec( void )
 #endif
 }
 
-#ifdef __APPLE__
+#if defined(__APPLE__) && !defined(__powerpc__)
 static mach_timebase_info_data_t mtime_timebase_info;
 static pthread_once_t mtime_timebase_info_once = PTHREAD_ONCE_INIT;
 static void mtime_init_timebase(void)
@@ -211,7 +211,7 @@ mtime_t mdate( void )
 #elif defined( HAVE_KERNEL_OS_H )
     res = real_time_clock_usecs();
 
-#elif defined( __APPLE__ )
+#elif defined(__APPLE__) && !defined(__powerpc__)
     pthread_once(&mtime_timebase_info_once, mtime_init_timebase);
     uint64_t date = mach_absolute_time();
 
@@ -364,7 +364,7 @@ void mwait( mtime_t date )
         ts.tv_sec = d.quot; ts.tv_nsec = d.rem * 1000;
         while( clock_nanosleep( CLOCK_REALTIME, 0, &ts, NULL ) == EINTR );
     }
-#elif defined( __APPLE__ ) /* The version that should be used, if it was cancelable */
+#elif defined(__APPLE__) && !defined(__powerpc__) /* The version that should be used, if it was cancelable */
     pthread_once(&mtime_timebase_info_once, mtime_init_timebase);
     uint64_t mach_time = date * 1000 * mtime_timebase_info.denom / mtime_timebase_info.numer;
     mach_wait_until(mach_time);
@@ -414,7 +414,7 @@ void msleep( mtime_t delay )
 
     while( nanosleep( &ts_delay, &ts_delay ) && ( errno == EINTR ) );
 
-#elif defined( __APPLE__ ) /* The version that should be used, if it was cancelable */
+#elif defined( __APPLE__) && !defined(__powerpc__) /* The version that should be used, if it was cancelable */
     pthread_once(&mtime_timebase_info_once, mtime_init_timebase);
     uint64_t mach_time = delay * 1000 * mtime_timebase_info.denom / mtime_timebase_info.numer;
     mach_wait_until(mach_time + mach_absolute_time());




More information about the vlc-devel mailing list