From 0fc556739bf2fedfbd5ba4f3e2d7a755baeacf24 Mon Sep 17 00:00:00 2001 From: "darin@apple.com" Date: Fri, 7 Dec 2007 23:53:01 +0000 Subject: [PATCH] - 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. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28539 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebCore/ChangeLog | 9 +++++++++ .../graphics/mac/MediaPlayerPrivateQTKit.mm | 18 ++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index fa5681d4e823..28ab13aa9b7d 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,12 @@ +2007-12-07 Darin Adler + + - 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 Reviewed by Anders diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm index bc96dbb556ae..0acac9b96d7d 100644 --- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm +++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm @@ -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; -- 2.36.0