Summary: | amarok freezes when trying to play mp3 files without mp3 support | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Maxime Gamboni <tendays-kde> |
Component: | general | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | 1.4.5 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Maxime Gamboni
2007-06-23 13:15:51 UTC
The problem is still there with 1.4.7. Steps to reproduce: setup amarok to use the xine engine remove mp3 support from xine Install following service /opt/kde3/share/services/amarok_xine-mp3_install.desktop [Desktop Entry] Encoding=UTF-8 Type=Service ServiceTypes=Amarok/CodecInstall X-KDE-Amarok-codec=mp3 X-KDE-Amarok-engine=xine-engine Exec=echo blah > /tmp/log Now if you have a mp3 file laying in your home the popup will work as expected but if you start it without a mp3 file in your home dir or playlist and try to add a mp3 file to the playlist amarok will freeze the moment the dialog pops up. SVN commit 706845 by markey: Fixed possible GUI freeze when Amarok was showing the dialog for installing mp3 support. Patch by Sascha Sommer <ssommer@suse.de>. "The problem seems to be that EngineController::canDecode runs in a seperate thread than the gui thread. Opening up a Kmessagebox there will prevent amarok from handling all gui events and everything will freeze. I therefore put the dialog into an extra function that will later get called from the statusBar." BUG: 147126 M +4 -0 ChangeLog M +15 -7 src/enginecontroller.cpp M +1 -0 src/enginecontroller.h M +8 -3 src/statusbar/statusBarBase.cpp --- branches/stable/extragear/multimedia/amarok/ChangeLog #706844:706845 @@ -2,8 +2,12 @@ ================ (C) 2002-2007 the Amarok authors. + VERSION 1.4.8 BUGFIXES: + * Fixed possible GUI freeze when Amarok was showing the dialog for + installing mp3 support. Patch by Sascha Sommer <ssommer@suse.de>. + (BR 147126) * Amarok could needlessely reinitialize connections to MySQL databases after a configuration change. Combined with a bug in MySQL libraries, this could lead to a crash. --- branches/stable/extragear/multimedia/amarok/src/enginecontroller.cpp #706844:706845 @@ -244,13 +244,10 @@ if( engine() != EngineController::instance()->m_voidEngine ) { //we special case this as otherwise users hate us - if ( !valid && ext.lower() == "mp3" && !installDistroCodec(AmarokConfig::soundSystem()) ) - Amarok::StatusBar::instance()->longMessageThreadSafe( - i18n( "<p>The %1 claims it <b>cannot</b> play MP3 files." - "<p>You may want to choose a different engine from the <i>Configure Dialog</i>, or examine " - "the installation of the multimedia-framework that the current engine uses. " - "<p>You may find useful information in the <i>FAQ</i> section of the <i>Amarok HandBook</i>." ) - .arg( AmarokConfig::soundSystem() ), KDE::StatusBar::Error ); + if ( !valid && ext.lower() == "mp3"){ + QCustomEvent * e = new QCustomEvent( 2000 ); + QApplication::postEvent( Amarok::StatusBar::instance(), e ); + } // Cache this result for the next lookup if ( !ext.isEmpty() ) @@ -260,6 +257,17 @@ return valid; } +void EngineController::unplayableNotification() { + + if( !installDistroCodec(AmarokConfig::soundSystem())) + Amarok::StatusBar::instance()->longMessageThreadSafe( + i18n( "<p>The %1 claims it <b>cannot</b> play MP3 files." + "<p>You may want to choose a different engine from the <i>Configure Dialog</i>, or examine " + "the installation of the multimedia-framework that the current engine uses. " + "<p>You may find useful information in the <i>FAQ</i> section of the <i>Amarok HandBook</i>." ) + .arg( AmarokConfig::soundSystem() ), KDE::StatusBar::Error ); +} + bool EngineController::installDistroCodec( const QString& engine /*Filetype type*/) { KService::Ptr service = KTrader::self()->query( "Amarok/CodecInstall" --- branches/stable/extragear/multimedia/amarok/src/enginecontroller.h #706844:706845 @@ -52,6 +52,7 @@ uint trackPosition() const; EngineBase* loadEngine(); + void unplayableNotification(); uint trackLength() const { return m_bundle.length() * 1000; } const MetaBundle &bundle() const; --- branches/stable/extragear/multimedia/amarok/src/statusbar/statusBarBase.cpp #706844:706845 @@ -25,6 +25,7 @@ #include "squeezedtextlabel.h" #include "statusBarBase.h" #include "threadmanager.h" +#include "enginecontroller.h" #include <kio/job.h> #include <kiconloader.h> @@ -343,9 +344,13 @@ void StatusBar::customEvent( QCustomEvent *e ) { - QString *s = static_cast<QString*>( e->data() ); - longMessage( *s ); - delete s; + if(e->type() == 1000 ){ + QString *s = static_cast<QString*>( e->data() ); + longMessage( *s ); + delete s; + }else if(e->type() == 2000 ){ + EngineController::instance()->unplayableNotification(); + } } |