Version: svn (using Devel) Compiler: gcc 4.3.2 gentoo OS: Linux Installed from: Compiled sources The file browser seems only to show mp3s and folders. It does not show all the files that amarok is able to play. It shows nothing for a directory full of m4as, for example.
I've also seen similar behaviour of the filebrowser, with m4a files, even though my system can play them.
Created attachment 28073 [details] Partial fix using EngineController::canDecode Patch by Jason A. Donenfeld <Jason@zx2c4.com> The proper way to filter the filebrowser would be to use EngineController::canDecode, which the attached patch uses. The problem is that the EngineController::canDecode uses Phonon::BackendCapabilities::isMimeTypeAvailable, which seems to return false when it should not. Therefore, after applying this patch, the problem would exist with Phonon.
Created attachment 28074 [details] Workaround to isMimeTypeAvailable bugs Patch by Jason A. Donenfeld <Jason@zx2c4.com> This patch works around the flaws in Phonon::BackendCapabilities::isMimeTypeAvailable by using hard coded values. All over Amarok, canDecode is used to determine if a file is playable, so any workarounds or replacements for isMimeTypeAvailable should be in canDecode.
Comment on attachment 28074 [details] Workaround to isMimeTypeAvailable bugs >Index: src/EngineController.cpp >=================================================================== >--- src/EngineController.cpp (revision 874993) >+++ src/EngineController.cpp (working copy) >@@ -162,7 +162,13 @@ > return false; > > KFileItem item( KFileItem::Unknown, KFileItem::Unknown, url ); >- const bool valid = Phonon::BackendCapabilities::isMimeTypeAvailable( item.mimetype() ); >+ const bool valid = Phonon::BackendCapabilities::isMimeTypeAvailable( item.mimetype() ) >+ //HACK: workaround for isMimeTypeAvailable's bugs >+ || ext == "mp3" + || ext == "m4a" >+ || ext == "wma" >+ || ext == "ogg" >+ || ext == "wav" >+ || ext == "flac"; > > //we special case this as otherwise users hate us > if ( !valid && ext.toLower() == "mp3" && !installDistroCodec() ) >Index: src/browsers/filebrowser/MyDirLister.cpp >=================================================================== >--- src/browsers/filebrowser/MyDirLister.cpp (revision 874993) >+++ src/browsers/filebrowser/MyDirLister.cpp (working copy) >@@ -37,7 +37,6 @@ > EngineController::canDecode( item.url() ) || > item.url().protocol() == "audiocd" || > PlaylistManager::isPlaylist( item.url() ) || >- item.name().endsWith( ".mp3", Qt::CaseInsensitive ) || //for now this is less confusing for the user > item.name().endsWith( ".aa", Qt::CaseInsensitive ) || //for adding to iPod > item.name().endsWith( ".mp4", Qt::CaseInsensitive ) || //for adding to iPod > item.name().endsWith( ".m4v", Qt::CaseInsensitive ) || //for adding to iPod
Created attachment 28075 [details] Fixes the problem using proper mime types and cleans up obsolete code Patch by Jason A. Donenfeld <Jason@zx2c4.com> The old way of checking for file extensions is incompatible with the new way of checking for mime types, as one wrong mimetyped file would corrupt the file extension cache. By using only mimetypes to check, we can filter out videos and images by filtering the mimetype list. This entire process is faster and has less overhead than the previous way. The attached patch replaces the extensioncache with a mimetype qstringlist that is populated on the first call to canDecode.
Created attachment 28076 [details] Fixes the problem using proper mime types and cleans up obsolete code Patch by Jason A. Donenfeld <Jason@zx2c4.com> The old way of checking for file extensions is incompatible with the new way of checking for mime types, as one wrong mimetyped file would corrupt the file extension cache. By using only mimetypes to check, we can filter out videos and images by filtering the mimetype list. This entire process is faster and has less overhead than the previous way. The attached patch replaces the extensioncache with a mimetype qstringlist that is populated on the first call to canDecode. Additionally, the table is now local, and the accessor functions have been removed, as this data should only be queried by way of canDecode. MusicBrainz and FetchCover checks have been removed, as those were for amarok1.
SVN commit 875009 by dmeltzer: Fix flaws in EngineController::canDecode that led to a number of false positives. EngineController::canDecode was still caching extensions but checking mime types. This patch resolves this by caching mime types instead. This also simplifies the code in EngineController::canDecode and allows us to eliminate hacks to work around the issue in other parts of Amarok. Patch by Jason A. Donenfeld <Jason@zx2c4.com> BUG: 173333 M +3 -1 ChangeLog M +16 -30 src/EngineController.cpp M +1 -5 src/EngineController.h M +1 -5 src/collection/CollectionManager.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=875009