summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/loopcontrol.cpp
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/loopcontrol.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp42
1 files changed, 25 insertions, 17 deletions
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp
index 4ed5921..91153fd 100644
--- a/core/multimedia/opieplayer/loopcontrol.cpp
+++ b/core/multimedia/opieplayer/loopcontrol.cpp
@@ -21,3 +21,12 @@
21 21
22
23#include "mediaplayerstate.h"
24#include "loopcontrol.h"
25#include "videowidget.h"
26#include "audiodevice.h"
27
28/* OPIE */
22#include <qpe/qpeapplication.h> 29#include <qpe/qpeapplication.h>
30#include <qpe/mediaplayerplugininterface.h>
31#include <opie2/odebug.h>
23 32
@@ -26,2 +35,6 @@
26#endif 35#endif
36
37/* QT */
38
39/* STD */
27#include <stdio.h> 40#include <stdio.h>
@@ -32,7 +45,2 @@
32#include <unistd.h> 45#include <unistd.h>
33#include "loopcontrol.h"
34#include "videowidget.h"
35#include "audiodevice.h"
36#include <qpe/mediaplayerplugininterface.h>
37#include "mediaplayerstate.h"
38 46
@@ -102,3 +110,3 @@ LoopControl::LoopControl( QObject *parent, const char *name )
102 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) ); 110 connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) );
103 //qDebug("starting loopcontrol"); 111 //odebug << "starting loopcontrol" << oendl;
104 audioMutex = new Mutex; 112 audioMutex = new Mutex;
@@ -114,3 +122,3 @@ LoopControl::LoopControl( QObject *parent, const char *name )
114 } else { 122 } else {
115 // qDebug( "Error setting up a realtime thread, reverting to using a normal thread." ); 123 // odebug << "Error setting up a realtime thread, reverting to using a normal thread." << oendl;
116 pthread_attr_destroy(&audio_attr); 124 pthread_attr_destroy(&audio_attr);
@@ -119,3 +127,3 @@ LoopControl::LoopControl( QObject *parent, const char *name )
119#endif 127#endif
120 //qDebug("create audio thread"); 128 //odebug << "create audio thread" << oendl;
121 pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this); 129 pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this);
@@ -155,3 +163,3 @@ void LoopControl::setPosition( long pos ) {
155 audioMutex->lock(); 163 audioMutex->lock();
156// qDebug("Loop control %d", pos); 164// odebug << "Loop control " << pos << "" << oendl;
157 if ( hasVideoChannel && hasAudioChannel ) { 165 if ( hasVideoChannel && hasAudioChannel ) {
@@ -230,3 +238,3 @@ void LoopControl::startAudio() {
230// if ( currentSample != audioSampleCounter + 1 ) 238// if ( currentSample != audioSampleCounter + 1 )
231// qDebug("out of sync with decoder %i %i", currentSample, audioSampleCounter); 239// odebug << "out of sync with decoder " << currentSample << " " << audioSampleCounter << "" << oendl;
232 240
@@ -243,3 +251,3 @@ void LoopControl::startAudio() {
243 else if ( sampleWaitTime <= -5000 ) { 251 else if ( sampleWaitTime <= -5000 ) {
244 // qDebug("need to catch up by: %li (%i,%li)", -sampleWaitTime, currentSample, sampleWeShouldBeAt ); 252 // odebug << "need to catch up by: " << -sampleWaitTime << " (" << currentSample << "," << sampleWeShouldBeAt << ")" << oendl;
245 // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream ); 253 // //mediaPlayerState->curDecoder()->audioSetSample( sampleWeShouldBeAt, stream );
@@ -363,3 +371,3 @@ bool LoopControl::init( const QString& filename ) {
363 371
364 // qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() ); 372 // odebug << "Using the " << mediaPlayerState->curDecoder()->pluginName() << " decoder" << oendl;
365 373
@@ -389,3 +397,3 @@ bool LoopControl::init( const QString& filename ) {
389 397
390 // qDebug( "LC- channels = %d", channels ); 398 // odebug << "LC- channels = " << channels << "" << oendl;
391 399
@@ -395,3 +403,3 @@ bool LoopControl::init( const QString& filename ) {
395 total_audio_samples += 1000; 403 total_audio_samples += 1000;
396 // qDebug("total samples %d", total_audio_samples); 404 // odebug << "total samples " << total_audio_samples << "" << oendl;
397 mediaPlayerState->setLength( total_audio_samples ); 405 mediaPlayerState->setLength( total_audio_samples );
@@ -399,3 +407,3 @@ bool LoopControl::init( const QString& filename ) {
399 freq = mediaPlayerState->curDecoder()->audioFrequency( astream ); 407 freq = mediaPlayerState->curDecoder()->audioFrequency( astream );
400 // qDebug( "LC- frequency = %d", freq ); 408 // odebug << "LC- frequency = " << freq << "" << oendl;
401 409
@@ -405,3 +413,3 @@ bool LoopControl::init( const QString& filename ) {
405 bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime(); 413 bits_per_sample =(int) mediaPlayerState->curDecoder()->getTime();
406 // qDebug("using stupid hack"); 414 // odebug << "using stupid hack" << oendl;
407 } else { 415 } else {
@@ -453,3 +461,3 @@ bool LoopControl::init( const QString& filename ) {
453void LoopControl::play() { 461void LoopControl::play() {
454 // qDebug("LC- play"); 462 // odebug << "LC- play" << oendl;
455 mediaPlayerState->setPosition( 0); //uglyhack 463 mediaPlayerState->setPosition( 0); //uglyhack