- fix 64-bit build, hopefully without breaking Tiger build
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2007 23:53:01 +0000 (23:53 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2007 23:53:01 +0000 (23:53 +0000)
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivate::updateStates):
        Don't use Movies.h constants that are nonexistent in 64-bit.
        Define the new QTMovie.h constants, though, when using an older QTKit.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28539 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm

index fa5681d..28ab13a 100644 (file)
@@ -1,3 +1,12 @@
+2007-12-07  Darin Adler  <darin@apple.com>
+
+        - fix 64-bit build, hopefully without breaking Tiger build
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivate::updateStates):
+        Don't use Movies.h constants that are nonexistent in 64-bit.
+        Define the new QTMovie.h constants, though, when using an older QTKit.
+
 2007-12-07  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Anders
index bc96dbb..0acac9b 100644 (file)
@@ -73,6 +73,16 @@ SOFT_LINK_POINTER(QTKit, QTMovieVolumeDidChangeNotification, NSString *)
 #define QTMovieTimeScaleAttribute getQTMovieTimeScaleAttribute()
 #define QTMovieVolumeDidChangeNotification getQTMovieVolumeDidChangeNotification()
 
+// Older versions of the QTKit header don't have these constants.
+#if QTKIT_VERSION_MAX_ALLOWED <= QTKIT_VERSION_7_0
+enum {
+    QTMovieLoadStateLoaded  = 2000L,
+    QTMovieLoadStatePlayable = 10000L,
+    QTMovieLoadStatePlaythroughOK = 20000L,
+    QTMovieLoadStateComplete = 100000L
+};
+#endif
+
 using namespace WebCore;
 using namespace std;
 
@@ -482,19 +492,19 @@ void MediaPlayerPrivate::updateStates()
     
     long loadState = m_qtMovie ? [[m_qtMovie.get() attributeForKey:QTMovieLoadStateAttribute] longValue] : -1;
     // "Loaded" is reserved for fully buffered movies, never the case when streaming
-    if (loadState >= kMovieLoadStateComplete && !m_isStreaming) {
+    if (loadState >= QTMovieLoadStateComplete && !m_isStreaming) {
         if (m_networkState < MediaPlayer::Loaded)
             m_networkState = MediaPlayer::Loaded;
         m_readyState = MediaPlayer::CanPlayThrough;
-    } else if (loadState >= kMovieLoadStatePlaythroughOK) {
+    } else if (loadState >= QTMovieLoadStatePlaythroughOK) {
         if (m_networkState < MediaPlayer::LoadedFirstFrame && !seeking())
             m_networkState = MediaPlayer::LoadedFirstFrame;
         m_readyState = ([m_qtMovie.get() rate] == 0 && m_startedPlaying) ? MediaPlayer::DataUnavailable : MediaPlayer::CanPlayThrough;
-    } else if (loadState >= kMovieLoadStatePlayable) {
+    } else if (loadState >= QTMovieLoadStatePlayable) {
         if (m_networkState < MediaPlayer::LoadedFirstFrame && !seeking())
             m_networkState = MediaPlayer::LoadedFirstFrame;
         m_readyState = ([m_qtMovie.get() rate] == 0 && m_startedPlaying) ? MediaPlayer::DataUnavailable : MediaPlayer::CanPlay;
-    } else if (loadState >= kMovieLoadStateLoaded) {
+    } else if (loadState >= QTMovieLoadStateLoaded) {
         if (m_networkState < MediaPlayer::LoadedMetaData)
             m_networkState = MediaPlayer::LoadedMetaData;
         m_readyState = MediaPlayer::DataUnavailable;