summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/loopcontrol.cpp
authorllornkcor <llornkcor>2003-02-25 23:38:02 (UTC)
committer llornkcor <llornkcor>2003-02-25 23:38:02 (UTC)
commit94cb45ce60cc00d719a802baeb8acf74f42150d2 (patch) (side-by-side diff)
tree27f70d60579a5301f04986e56cf4bfa2067dad9c /core/multimedia/opieplayer/loopcontrol.cpp
parentbde9ed97c92b6f7eefa8a66d9f58aa4c78127733 (diff)
downloadopie-94cb45ce60cc00d719a802baeb8acf74f42150d2.zip
opie-94cb45ce60cc00d719a802baeb8acf74f42150d2.tar.gz
opie-94cb45ce60cc00d719a802baeb8acf74f42150d2.tar.bz2
remove libmad depending on libmpeg3, and fix crash when skin not found
Diffstat (limited to 'core/multimedia/opieplayer/loopcontrol.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/loopcontrol.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/multimedia/opieplayer/loopcontrol.cpp b/core/multimedia/opieplayer/loopcontrol.cpp
index ba14882..8cf0a75 100644
--- a/core/multimedia/opieplayer/loopcontrol.cpp
+++ b/core/multimedia/opieplayer/loopcontrol.cpp
@@ -97,13 +97,13 @@ Mutex *audioMutex;
LoopControl::LoopControl( QObject *parent, const char *name )
: QObject( parent, name ) {
isMuted = FALSE;
connect( qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( setMute(bool) ) );
-//qDebug("starting loopcontrol");
+qDebug("starting loopcontrol");
audioMutex = new Mutex;
pthread_attr_init(&audio_attr);
#define USE_REALTIME_AUDIO_THREAD
#ifdef USE_REALTIME_AUDIO_THREAD
// Attempt to set it to real-time round robin
@@ -114,13 +114,13 @@ LoopControl::LoopControl( QObject *parent, const char *name )
} else {
qDebug( "Error setting up a realtime thread, reverting to using a normal thread." );
pthread_attr_destroy(&audio_attr);
pthread_attr_init(&audio_attr);
}
#endif
-//qDebug("create audio thread");
+qDebug("create audio thread");
pthread_create(&audio_tid, &audio_attr, (void * (*)(void *))startAudioThread, this);
}
LoopControl::~LoopControl() {
stop();
@@ -361,18 +361,18 @@ bool LoopControl::init( const QString& filename ) {
stream = 0; // only play stream 0 for now
current_frame = total_video_frames = total_audio_samples = 0;
qDebug( "Using the %s decoder", mediaPlayerState->curDecoder()->pluginName() );
// ### Hack to use libmpeg3plugin to get the number of audio samples if we are using the libmad plugin
- if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibMadPlugin") ) {
- if ( mediaPlayerState->libMpeg3Decoder() && mediaPlayerState->libMpeg3Decoder()->open( filename )) {
- total_audio_samples = mediaPlayerState->libMpeg3Decoder()->audioSamples( 0 );
- mediaPlayerState->libMpeg3Decoder()->close();
- }
- }
+// if ( mediaPlayerState->curDecoder()->pluginName() == QString("LibMadPlugin") ) {
+// if ( mediaPlayerState->libMpeg3Decoder() && mediaPlayerState->libMpeg3Decoder()->open( filename )) {
+// total_audio_samples = mediaPlayerState->libMpeg3Decoder()->audioSamples( 0 );
+// mediaPlayerState->libMpeg3Decoder()->close();
+// }
+// }
if ( !mediaPlayerState->curDecoder()|| !mediaPlayerState->curDecoder()->open( filename ) ) {
audioMutex->unlock();
return FALSE;
}
@@ -386,17 +386,17 @@ bool LoopControl::init( const QString& filename ) {
channels = 2; //dont akx me why, but it needs this hack
else
channels = mediaPlayerState->curDecoder()->audioChannels( astream );
qDebug( "LC- channels = %d", channels );
- if ( !total_audio_samples )
+// if ( !total_audio_samples )
total_audio_samples = mediaPlayerState->curDecoder()->audioSamples( astream );
total_audio_samples += 1000;
-
+ qDebug("total samples %d", total_audio_samples);
mediaPlayerState->setLength( total_audio_samples );
freq = mediaPlayerState->curDecoder()->audioFrequency( astream );
qDebug( "LC- frequency = %d", freq );
audioSampleCounter = 0;