Bug 194889 - can't play files with # in the filename
Summary: can't play files with # in the filename
Status: RESOLVED FIXED
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: Xine backend (show other bugs)
Version: 4.3.0 (KDE 4.2.0)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Matthias Kretz
URL:
Keywords:
: 196355 197035 197349 197583 198745 199182 200585 205519 206923 208904 210704 210903 211355 213700 214731 224945 229188 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-01 18:10 UTC by Mikko C.
Modified: 2010-12-05 21:36 UTC (History)
15 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.4.1
Sentry Crash Report:


Attachments
proposed simple patch, including only # (530 bytes, patch)
2009-06-14 15:11 UTC, Jakob Kummerow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikko C. 2009-06-01 18:10:46 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

I just noticed that neither Amarok nor Dragonplayer can play files with # in the filename.
I have Phonon from trunk with Xine backend: xine-lib-1.1.16.3
No pulseaudio or such.

This is the output of amarok (it stops playing) when it tries to play a file with # in the filename:

amarok: BEGIN: void EngineController::slotAboutToFinish() 
amarok:   [EngineController] Track finished completely, updating statistics       
amarok:   BEGIN: virtual void LyricsEngine::metadataChanged(Meta::TrackPtr)       
amarok:   END__: virtual void LyricsEngine::metadataChanged(Meta::TrackPtr) - Took 0.00017s 
amarok:   BEGIN: virtual void Amarok::OSD::metadataChanged(Meta::TrackPtr)                  
amarok:     BEGIN: void OSDWidget::show(const QString&, QImage)                             
amarok:     END__: void OSDWidget::show(const QString&, QImage) - Took 0.00013s             
amarok:   END__: virtual void Amarok::OSD::metadataChanged(Meta::TrackPtr) - Took 0.0016s   
amarok:   BEGIN: virtual void LyricsEngine::metadataChanged(Meta::TrackPtr)                 
amarok:   END__: virtual void LyricsEngine::metadataChanged(Meta::TrackPtr) - Took 0.00017s 
amarok:   BEGIN: virtual void Amarok::OSD::metadataChanged(Meta::TrackPtr)                  
amarok:     BEGIN: void OSDWidget::show(const QString&, QImage)                             
amarok:     END__: void OSDWidget::show(const QString&, QImage) - Took 0.00012s             
amarok:   END__: virtual void Amarok::OSD::metadataChanged(Meta::TrackPtr) - Took 0.0016s   
amarok:   BEGIN: void Playlist::Actions::play(quint64, bool)                                
amarok:   END__: void Playlist::Actions::play(quint64, bool) - Took 0.00017s                
amarok: END__: void EngineController::slotAboutToFinish() - Took 0.055s                     
xine_open for gapless playback failed!                                                      
amarok: BEGIN: void EngineController::slotNewTrackPlaying(const Phonon::MediaSource&)       
amarok:   [EngineController] Using gain of 0 with relative peak of 0                        
amarok:   BEGIN: void EngineSubject::stateChangedNotify(Phonon::State, Phonon::State)       
amarok:     BEGIN: virtual void Amarok::PlayPauseAction::engineStateChanged(Phonon::State, Phonon::State) 
amarok:        NEWSTATE:  2 OLDSTATE:  2                                                                  
amarok:     END__: virtual void Amarok::PlayPauseAction::engineStateChanged(Phonon::State, Phonon::State) - Took 0.00019s 
amarok:      returning bookmarkcurrenttrack action                                                                        
amarok:     BEGIN: virtual void Context::ContextView::engineStateChanged(Phonon::State, Phonon::State)                    
amarok:       BEGIN: virtual void LyricsEngine::message(const Context::ContextState&)                                     
amarok:         BEGIN: void LyricsEngine::update()                                                                        
amarok:           BEGIN: void ScriptManager::notifyFetchLyrics(const QString&, const QString&)                            
amarok:              SCRIPT "Lyricwiki" :  "request URL: http://lyricwiki.org/api.php?func=getSong&artist=Air&song=Radio #1&fmt=xml"                                                                                                                      
amarok:             BEGIN: static QScriptValue Downloader::init(QScriptContext*, QScriptEngine*, bool)                       
amarok:             END__: static QScriptValue Downloader::init(QScriptContext*, QScriptEngine*, bool) - Took 0.0005s        
amarok:           END__: void ScriptManager::notifyFetchLyrics(const QString&, const QString&) - Took 0.014s                 
amarok:         END__: void LyricsEngine::update() - Took 0.017s                                                             
amarok:       END__: virtual void LyricsEngine::message(const Context::ContextState&) - Took 0.017s                          
amarok:       BEGIN: virtual void CurrentEngine::message(const Context::ContextState&)                                       
amarok:         BEGIN: void CurrentEngine::update()                                                                          
amarok:         END__: void CurrentEngine::update() - Took 0.015s                                                            
amarok:       END__: virtual void CurrentEngine::message(const Context::ContextState&) - Took 0.015s                         
amarok:     END__: virtual void Context::ContextView::engineStateChanged(Phonon::State, Phonon::State) - Took 0.033s         
amarok:      returning bookmarkcurrenttrack action                                                                           
amarok:     BEGIN: virtual void StatusBar::engineStateChanged(Phonon::State, Phonon::State)                                  
amarok:        PlayingState: clear text                                                                                      
amarok:     END__: virtual void StatusBar::engineStateChanged(Phonon::State, Phonon::State) - Took 0.00042s                  
amarok:     BEGIN: virtual void MainWindow::engineStateChanged(Phonon::State, Phonon::State)                                 
amarok:       [MainWindow] Phonon state:  2                                                                                  
amarok:     END__: virtual void MainWindow::engineStateChanged(Phonon::State, Phonon::State) - Took 0.00015s                 
amarok:     BEGIN: virtual void ProgressWidget::engineStateChanged(Phonon::State, Phonon::State)                             
amarok:     END__: virtual void ProgressWidget::engineStateChanged(Phonon::State, Phonon::State) - Took 5.2e-05s             
amarok:     BEGIN: virtual void Amarok::OSD::engineStateChanged(Phonon::State, Phonon::State)                                
amarok:       BEGIN: virtual void Amarok::OSD::metadataChanged(Meta::TrackPtr)                                               
amarok:         BEGIN: void OSDWidget::show(const QString&, QImage)                                                          
amarok:         END__: void OSDWidget::show(const QString&, QImage) - Took 6.7e-05s                                          
amarok:       END__: virtual void Amarok::OSD::metadataChanged(Meta::TrackPtr) - Took 0.00045s                               
amarok:     END__: virtual void Amarok::OSD::engineStateChanged(Phonon::State, Phonon::State) - Took 0.00054s                
amarok:   END__: void EngineSubject::stateChangedNotify(Phonon::State, Phonon::State) - Took 0.06s                           
amarok:    returning bookmarkcurrenttrack action                                                                             
amarok:   BEGIN: virtual void ProgressWidget::engineNewTrackPlaying()                                                        
amarok:     BEGIN: virtual void ProgressWidget::engineTrackLengthChanged(long int)                                           
amarok:        new length:  262                                                                                              
amarok:        slider enabled!                                                                                               
amarok:        here 1                                                                                                        
amarok:        here 2                                                                                                        
amarok:       BEGIN: static BookmarkList PlayUrlRunner::bookmarksFromUrl(KUrl)                                               
amarok:          query:  "SELECT id, parent_id, name, url, description, custom FROM bookmarks WHERE url LIKE '%ZmlsZTovLy9tbnQvbXlib29rL01wMy9BL0FpciUyMC0lMjAlNUIyMDAxJTVEJTIwMTAwMDAlMjBIeiUyMExlZ2VuZC8wMyUyMC0lMjBSYWRpbyUyMCUyMzEubXA%'"             
amarok:       END__: static BookmarkList PlayUrlRunner::bookmarksFromUrl(KUrl) - Took 0.00067s                               
amarok:     END__: virtual void ProgressWidget::engineTrackLengthChanged(long int) - Took 0.0009s                            
amarok:   END__: virtual void ProgressWidget::engineNewTrackPlaying() - Took 0.001s                                          
amarok:   BEGIN: void Playlist::PrettyListView::scrollToActiveTrack()                                                        
amarok:     [Playlist::PrettyListView] skipping scroll? false                                                                
amarok:   END__: void Playlist::PrettyListView::scrollToActiveTrack() - Took 0.00028s                                        
amarok:   BEGIN: virtual void TimecodeObserver::engineNewTrackPlaying()                                                      
amarok:      curent track name:  "Radio #1"                                                                                  
amarok:      Track timecodeable                                                                                              
amarok:   END__: virtual void TimecodeObserver::engineNewTrackPlaying() - Took 0.00012s                                      
amarok: END__: void EngineController::slotNewTrackPlaying(const Phonon::MediaSource&) - Took 0.096s                          
amarok: BEGIN: void EngineController::slotStateChanged(Phonon::State, Phonon::State)                                         
amarok:   BEGIN: void EngineSubject::stateChangedNotify(Phonon::State, Phonon::State)                                        
amarok:     BEGIN: virtual void Amarok::PlayPauseAction::engineStateChanged(Phonon::State, Phonon::State)                    
amarok:        NEWSTATE:  1 OLDSTATE:  2                                                                                     
amarok:     END__: virtual void Amarok::PlayPauseAction::engineStateChanged(Phonon::State, Phonon::State) - Took 9.1e-05s    
amarok:      returning bookmarkcurrenttrack action                                                                           
amarok:     BEGIN: virtual void Context::ContextView::engineStateChanged(Phonon::State, Phonon::State)                       
amarok:       BEGIN: virtual void LyricsEngine::message(const Context::ContextState&)                                        
amarok:       END__: virtual void LyricsEngine::message(const Context::ContextState&) - Took 0.00019s                        
amarok:       BEGIN: virtual void CurrentEngine::message(const Context::ContextState&)                                       
amarok:       END__: virtual void CurrentEngine::message(const Context::ContextState&) - Took 0.0002s                        
amarok:     END__: virtual void Context::ContextView::engineStateChanged(Phonon::State, Phonon::State) - Took 0.0011s        
amarok:     BEGIN: virtual void StatusBar::engineStateChanged(Phonon::State, Phonon::State)                                  
amarok:     END__: virtual void StatusBar::engineStateChanged(Phonon::State, Phonon::State) - Took 0.00025s                  
amarok:     BEGIN: virtual void MainWindow::engineStateChanged(Phonon::State, Phonon::State)                                 
amarok:       [MainWindow] Phonon state:  1                                                                                  
amarok:     END__: virtual void MainWindow::engineStateChanged(Phonon::State, Phonon::State) - Took 0.00041s                 
amarok:     BEGIN: virtual void ProgressWidget::engineStateChanged(Phonon::State, Phonon::State)                             
amarok:     END__: virtual void ProgressWidget::engineStateChanged(Phonon::State, Phonon::State) - Took 0.00022s             
amarok:     BEGIN: virtual void Amarok::OSD::engineStateChanged(Phonon::State, Phonon::State)                                
amarok:     END__: virtual void Amarok::OSD::engineStateChanged(Phonon::State, Phonon::State) - Took 0.00019s                
amarok:   END__: void EngineSubject::stateChangedNotify(Phonon::State, Phonon::State) - Took 0.039s                          
amarok: END__: void EngineController::slotStateChanged(Phonon::State, Phonon::State) - Took 0.039s                           
amarok: BEGIN: void EngineController::slotQueueEnded()                                                                       
amarok:   BEGIN: virtual void LyricsEngine::metadataChanged(Meta::TrackPtr)                                                  
amarok:   END__: virtual void LyricsEngine::metadataChanged(Meta::TrackPtr) - Took 9.9e-05s                                  
amarok:   BEGIN: virtual void Amarok::OSD::metadataChanged(Meta::TrackPtr)                                                   
amarok:     BEGIN: void OSDWidget::show(const QString&, QImage)                                                              
amarok:     END__: void OSDWidget::show(const QString&, QImage) - Took 0.00027s                                              
amarok:   END__: virtual void Amarok::OSD::metadataChanged(Meta::TrackPtr) - Took 0.014s                                     
amarok:   BEGIN: virtual void LyricsEngine::metadataChanged(Meta::TrackPtr)                                                  
amarok:   END__: virtual void LyricsEngine::metadataChanged(Meta::TrackPtr) - Took 9.6e-05s                                  
amarok:   BEGIN: virtual void Amarok::OSD::metadataChanged(Meta::TrackPtr)                                                   
amarok:     BEGIN: void OSDWidget::show(const QString&, QImage)                                                              
amarok:     END__: void OSDWidget::show(const QString&, QImage) - Took 0.00023s                                              
amarok:   END__: virtual void Amarok::OSD::metadataChanged(Meta::TrackPtr) - Took 0.0026s                                    
amarok:   BEGIN: virtual void ProgressWidget::enginePlaybackEnded(int, int, EngineObserver::PlaybackEndedReason)             
amarok:   END__: virtual void ProgressWidget::enginePlaybackEnded(int, int, EngineObserver::PlaybackEndedReason) - Took 0.00028s                                                                                                                          
amarok:   BEGIN: virtual void TimecodeObserver::enginePlaybackEnded(int, int, EngineObserver::PlaybackEndedReason)           
amarok:   END__: virtual void TimecodeObserver::enginePlaybackEnded(int, int, EngineObserver::PlaybackEndedReason) - Took 0.00019s                                                                                                                        
amarok: END__: void EngineController::slotQueueEnded() - Took 0.05s                                                          
amarok: BEGIN: void CurrentTrack::dataUpdated(const QString&, const QHash<QString, QVariant>&)                               
amarok: END__: void CurrentTrack::dataUpdated(const QString&, const QHash<QString, QVariant>&) - Took 0.00075s               
amarok(13418)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-mikko/amarokF13418.slave-socket"                                                                                                              
amarok(13418)/kio (Slave) KIO::Slave::createSlave: createSlave "http" for KUrl("http://lyricwiki.org/api.php?func=getSong&artist=Air&song=Radio #1&fmt=xml")
amarok(13418)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-mikko/amarokI13418.slave-socket"
amarok: BEGIN: virtual void CurrentTrack::constraintsEvent(Plasma::Constraints)
amarok:    placing album at X: 12.5  and Y: 6.5
amarok: END__: virtual void CurrentTrack::constraintsEvent(Plasma::Constraints) - Took 0.014s
amarok: BEGIN: void AmarokDownloadHelper::resultString(KJob*)
amarok:   BEGIN: void AmarokScript::AmarokLyricsScript::showLyrics(const QString&) const
amarok:   END__: void AmarokScript::AmarokLyricsScript::showLyrics(const QString&) const - Took 0.00054s
amarok: END__: void AmarokDownloadHelper::resultString(KJob*) - Took 0.034s

amarok: BEGIN: void CurrentEngine::stoppedState()
amarok: END__: void CurrentEngine::stoppedState() - Took 0.00081s
amarok: BEGIN: void CurrentTrack::dataUpdated(const QString&, const QHash<QString, QVariant>&)
amarok: END__: void CurrentTrack::dataUpdated(const QString&, const QHash<QString, QVariant>&) - Took 0.00057s


amarok: BEGIN: void CurrentEngine::resultReady(const QString&, const Meta::TrackList&)
amarok: END__: void CurrentEngine::resultReady(const QString&, const Meta::TrackList&) - Took 0.00036s
amarok: BEGIN: void CurrentEngine::setupTracksData()
amarok: END__: void CurrentEngine::setupTracksData() - Took 0.00023s
amarok: BEGIN: void CurrentTrack::dataUpdated(const QString&, const QHash<QString, QVariant>&)
amarok: END__: void CurrentTrack::dataUpdated(const QString&, const QHash<QString, QVariant>&) - Took 0.00058s
amarok: BEGIN: virtual void CurrentTrack::constraintsEvent(Plasma::Constraints)
amarok:    placing album at X: 12.5  and Y: 6.5
amarok: END__: virtual void CurrentTrack::constraintsEvent(Plasma::Constraints) - Took 0.011s
Comment 1 Mikko C. 2009-06-01 18:13:40 UTC
And this is the output of Dragon Player trying to play the same file, which it can't play:

dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStream::KioMediaStream:
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStream::reset:
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStream::reset:
dragonplayer(13472)/kio (Slave) KIO::Slave::createSlave: createSlave "file" for KUrl("file:///mnt/mybook/Mp3/A/Air - [2001] 10000 Hz Legend/03 - Radio %231.mp3")
dragonplayer(13472)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-mikko/dragonplayerH13472.slave-socket"
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStreamPrivate::_k_bytestreamSeekDone: 0
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStreamPrivate::_k_bytestreamFileJobOpen: 8860351
xine is asking to seek behind the end of the data stream
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStream::seekStream: 8860223  =  8860223
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStreamPrivate::_k_bytestreamData: seeking: do nothing
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStreamPrivate::_k_bytestreamSeekDone: 8860223
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStreamPrivate::_k_bytestreamData: empty data: stopping the stream
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStream::seekStream: no job/job finished -> recreate it
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStream::reset:
dragonplayer(13472)/kio (Slave) KIO::Slave::kill: killing slave pid 13400 ( "file://" )
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStream::seekStream: 0  =  0
dragonplayer(13472)/kio (Slave) KIO::Slave::createSlave: createSlave "file" for KUrl("file:///mnt/mybook/Mp3/A/Air - [2001] 10000 Hz Legend/03 - Radio %231.mp3")
dragonplayer(13472)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-mikko/dragonplayerJ13472.slave-socket"
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStreamPrivate::_k_bytestreamSeekDone: 0
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStreamPrivate::_k_bytestreamFileJobOpen: 8860351
dragonplayer(13472)/phonon (KDE plugin) Phonon::KioMediaStream::enoughData:
Comment 2 Mikko C. 2009-06-13 18:18:36 UTC
*** Bug 196355 has been marked as a duplicate of this bug. ***
Comment 3 Jakob Kummerow 2009-06-14 15:10:29 UTC
I just had a look into the phonon source code and noticed that there is already some special treatment for non-alphanumerical characters in place there, but the listing of these cases isn't quite complete...

Proposed fix: 

In the file branches/phonon/4.3/xine/mediaobject.cpp, 
in the if-clause in line 324, append " || c == '#'", making the line look like this:

if (c & 0x80 || c == '\\' || c < 32 || c == '%' || c == '#') {

After recompiling phonon with this change, both dragon player and amarok were able to play a file containing # in its name :-)

Additional thought:

If someone thinks it's necessary, obviously one could also include any other characters that aren't working as of now into this list (I didn't test any others except #).
Maybe it would be even better to just extend the range of ASCII codes to some value above 32, i.e. to change the whole line to:

if (c & 0x80 || c == '\\' || c < 44) {

This would mean to include all of the following characters (note the space at the beginning):
 !"#$%&'()*+
Comment 4 Jakob Kummerow 2009-06-14 15:11:41 UTC
Created attachment 34522 [details]
proposed simple patch, including only #
Comment 5 Mikko C. 2009-06-14 15:49:47 UTC
does this patch apply to phonon/xine/mediaobject.cpp or phonon/phonon/mediaobject.cpp ?
Comment 6 Jakob Kummerow 2009-06-14 15:56:33 UTC
(In reply to comment #5)
> does this patch apply to phonon/xine/mediaobject.cpp or
> phonon/phonon/mediaobject.cpp ?

the patch applies to phonon/xine/mediaobject.cpp as found here: 
http://websvn.kde.org/branches/phonon/4.3/xine/mediaobject.cpp?revision=924144&view=markup
Comment 7 Mikko C. 2009-06-14 16:10:44 UTC
I can confirm the patch applies and works fine also with phonon from trunk.
Please apply it upstream. Thanks
Comment 8 Jakob Kummerow 2009-06-15 11:24:27 UTC
Comment on attachment 34522 [details]
proposed simple patch, including only #

see post #3 for additional comments.
Comment 9 Mikko C. 2009-06-18 18:04:14 UTC
*** Bug 197035 has been marked as a duplicate of this bug. ***
Comment 10 Mikko C. 2009-06-18 20:04:41 UTC
fixed in rev 983650
http://websvn.kde.org/?view=rev&revision=983650
Comment 11 Mikko C. 2009-06-21 11:10:46 UTC
*** Bug 197349 has been marked as a duplicate of this bug. ***
Comment 12 Mikko C. 2009-06-23 10:20:32 UTC
*** Bug 197583 has been marked as a duplicate of this bug. ***
Comment 13 Mikko C. 2009-07-03 09:47:30 UTC
*** Bug 198745 has been marked as a duplicate of this bug. ***
Comment 14 Kvikende 2009-07-07 15:12:42 UTC
*** Bug 199182 has been marked as a duplicate of this bug. ***
Comment 15 Mikko C. 2009-07-17 20:18:53 UTC
*** Bug 200585 has been marked as a duplicate of this bug. ***
Comment 16 Mikko C. 2009-08-28 20:46:19 UTC
*** Bug 205519 has been marked as a duplicate of this bug. ***
Comment 17 Mikko C. 2009-09-10 09:33:00 UTC
*** Bug 206923 has been marked as a duplicate of this bug. ***
Comment 18 Mikko C. 2009-09-29 22:11:56 UTC
*** Bug 208904 has been marked as a duplicate of this bug. ***
Comment 19 Mikko C. 2009-10-15 20:34:00 UTC
*** Bug 210704 has been marked as a duplicate of this bug. ***
Comment 20 Mikko C. 2009-10-17 20:30:17 UTC
*** Bug 210903 has been marked as a duplicate of this bug. ***
Comment 21 Mikko C. 2009-10-21 19:46:17 UTC
*** Bug 211355 has been marked as a duplicate of this bug. ***
Comment 22 Mark Kretschmann 2009-11-09 08:28:24 UTC
*** Bug 213700 has been marked as a duplicate of this bug. ***
Comment 23 Myriam Schweingruber 2009-11-16 01:01:27 UTC
*** Bug 214731 has been marked as a duplicate of this bug. ***
Comment 24 Mikko C. 2010-01-31 09:06:17 UTC
*** Bug 224945 has been marked as a duplicate of this bug. ***
Comment 25 Mikko C. 2010-03-04 12:23:21 UTC
*** Bug 229188 has been marked as a duplicate of this bug. ***