summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/loopcontrol.cpp
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/loopcontrol.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp
index 90a7cc6..cb8de8a 100644
--- a/core/multimedia/opieplayer/loopcontrol.cpp
+++ b/core/multimedia/opieplayer/loopcontrol.cpp
@@ -36,3 +36,3 @@
#include "audiodevice.h"
-#include "mediaplayerplugininterface.h"
+#include <qpe/mediaplayerplugininterface.h>
#include "mediaplayerstate.h"
@@ -103,3 +103,3 @@ LoopControl::LoopControl( QObject *parent, const char *name )
connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) );
-
+//qDebug("starting loopcontrol");
audioMutex = new Mutex;
@@ -120,2 +120,3 @@ LoopControl::LoopControl( QObject *parent, const char *name )
#endif
+//qDebug("create audio thread");
pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this);
@@ -222,4 +223,4 @@ void LoopControl::startAudio() {
+//qDebug("start audio");
audioMutex->lock();
-
if ( moreAudio ) {
@@ -238,10 +239,10 @@ void LoopControl::startAudio() {
- if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) {
- usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) );
- }
- else if ( sampleWaitTime <= -5000 ) {
- qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt );
- //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream );
- currentSample = sampleWeShouldBeAt;
- }
+// if ( ( sampleWaitTime > 2000 ) && ( sampleWaitTime < 20000 ) ) {
+// usleep( (long)((double)sampleWaitTime * 1000000.0 / freq) );
+// }
+// else if ( sampleWaitTime <= -5000 ) {
+// qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt );
+// //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream );
+// currentSample = sampleWeShouldBeAt;
+// }
@@ -393,4 +394,9 @@ bool LoopControl::init( const QString& filename ) {
audioSampleCounter = 0;
-
- int bits_per_sample = mediaPlayerState->curDecoder()->audioBitsPerSample( astream);
+ int bits_per_sample;
+ if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibWavPlugin") ) {
+ bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime();
+ qDebug("using stupid hack");
+ } else {
+ bits_per_sample=0;
+ }
@@ -439,3 +445,3 @@ bool LoopControl::init( const QString& filename ) {
void LoopControl::play() {
-
+ qDebug("LC- play");
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)