From 41b6c4dde81fa56ff06c3e93b1c579051450cbfa Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 13 May 2009 08:40:10 +0000 Subject: [PATCH] Rearranged static SDL callback so that it's after the SDL.h header. --- examples/osgmovie/osgmovie.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/osgmovie/osgmovie.cpp b/examples/osgmovie/osgmovie.cpp index 4c4a0bcb8..b5d7dc7f8 100644 --- a/examples/osgmovie/osgmovie.cpp +++ b/examples/osgmovie/osgmovie.cpp @@ -335,7 +335,6 @@ class SDLAudioSink : public osg::AudioSink virtual void startPlaying(); virtual bool playing() const { return _playing; } - static void soundReadCallback(void * user_data, uint8_t * data, int datalen); bool _playing; osg::observer_ptr _audioStream; @@ -603,6 +602,16 @@ int main(int argc, char** argv) #include "SDL.h" +static void soundReadCallback(void * user_data, uint8_t * data, int datalen) +{ + SDLAudioSink * sink = reinterpret_cast(user_data); + osg::ref_ptr as = sink->_audioStream.get(); + if (as.valid()) + { + as->consumeAudioBuffer(data, datalen); + } +} + SDLAudioSink::~SDLAudioSink() { if (_playing) @@ -642,15 +651,6 @@ void SDLAudioSink::startPlaying() } -void SDLAudioSink::soundReadCallback(void * const user_data, Uint8 * const data, const int datalen) -{ - SDLAudioSink * sink = reinterpret_cast(user_data); - osg::ref_ptr as = sink->_audioStream.get(); - if (as.valid()) - { - as->consumeAudioBuffer(data, datalen); - } -} #endif