summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/loopcontrol_threaded.cpp
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/loopcontrol_threaded.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/loopcontrol_threaded.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/multimedia/opieplayer/loopcontrol_threaded.cpp b/core/multimedia/opieplayer/loopcontrol_threaded.cpp
index 3796549..0a1fc17 100644
--- a/core/multimedia/opieplayer/loopcontrol_threaded.cpp
+++ b/core/multimedia/opieplayer/loopcontrol_threaded.cpp
@@ -536,89 +536,89 @@ bool LoopControl::init( const QString& filename ) {
if ( !total_audio_samples )
total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream );
mediaPlayerState->setLength( total_audio_samples );
freq = mediaPlayerState->curDecoder()->audioFrequency( astream );
DecodeLoopDebug(( "frequency = %d\n", freq ));
audioSampleCounter = 0;
static const int bytes_per_sample = 2; //16 bit
audioDevice = new AudioDevice( freq, channels, bytes_per_sample );
audioBuffer = new char[ audioDevice->bufferSize() ];
channels = audioDevice->channels();
//### must check which frequency is actually used.
static const int size = 1;
short int buf[size];
long samplesRead = 0;
mediaPlayerState->curDecoder()->audioReadSamples( buf, channels, size, samplesRead, stream );
}
if ( hasVideoChannel ) {
total_video_frames = mediaPlayerState->curDecoder()->videoFrames( stream );
mediaPlayerState->setLength( total_video_frames );
framerate = mediaPlayerState->curDecoder()->videoFrameRate( stream );
DecodeLoopDebug(( "Frame rate %g total %ld", framerate, total_video_frames ));
if ( framerate <= 1.0 ) {
DecodeLoopDebug(( "Crazy frame rate, resetting to sensible" ));
framerate = 25;
}
if ( total_video_frames == 1 ) {
DecodeLoopDebug(( "Cannot seek to frame" ));
}
}
videoMutex->lock();
current_frame = 0;
prev_frame = -1;
videoMutex->unlock();
- connect( mediaPlayerState, SIGNAL( positionChanged( long ) ), this, SLOT( setPosition( long ) ) );
- connect( mediaPlayerState, SIGNAL( pausedToggled( bool ) ), this, SLOT( setPaused( bool ) ) );
+ connect( mediaPlayerState, SIGNAL( positionChanged(long) ), this, SLOT( setPosition(long) ) );
+ connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( setPaused(bool) ) );
//setBackgroundColor( black );
return TRUE;
}
void LoopControl::play() {
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
if ( !disabledSuspendScreenSaver ) {
disabledSuspendScreenSaver = TRUE;
// Stop the screen from blanking and power saving state
QCopEnvelope("QPE/System", "setScreenSaverMode(int)" )
<< ( hasVideoChannel ? QPEApplication::Disable : QPEApplication::DisableSuspend );
}
#endif
//begin = clock();
playtime.start();
startTimers();
//updateGeometry();
}
void LoopControl::setMute( bool on ) {
if ( isMuted != on ) {
isMuted = on;
if ( isMuted ) {
} else {
int frame = current_frame; // mediaPlayerState->curDecoder()->videoGetFrame( stream );
playtime.restart();
playtime = playtime.addMSecs( -frame * 1000 / framerate );
//begin = clock() - (double)frame * CLOCKS_PER_SEC / framerate;
mediaPlayerState->curDecoder()->audioSetSample( frame*freq/framerate, stream );
}
}
}