Bug 190707 - JJ: Phonon::KioMediaStream failure to set error text when KIOJob returns error
Summary: JJ: Phonon::KioMediaStream failure to set error text when KIOJob returns error
Status: RESOLVED FIXED
Alias: None
Product: Phonon
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 4.3.0 (KDE 4.2.0)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Matthias Kretz
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2009-04-26 14:41 UTC by David Jarvie
Modified: 2010-12-05 21:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.4.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Jarvie 2009-04-26 14:41:50 UTC
Version:            (using KDE 4.2.2)
Compiler:          gcc 4.3 
OS:                Linux
Installed from:    Compiled From Sources

When Phonon::MediaObject::play() tries to open a non-existent audio file, debug messages from KioMediaStreamPrivate show an error

"The file or folder <...filename...> does not exist.".

But sometimes, although the MediaObject gets a signal that its state has changed to Phonon::ErrorState, the error text returned by MediaObject::errorString() is empty. Other times, the correct error text is returned. It seems to work about half of the time, so it's presumably some timing or sequencing issue that prevents it working reliably.

In the debug output below which shows the sequence of events, AudioThread::playStateChanged(Phonon::State) is a slot which is called by the MediaObject::stateChanged(Phonon::State, Phonon::State) signal. It receives the change in MediaObject::state() to Phonon::ErrorState, but the error text which it tries to retrieve is empty. Later on, before deleting the MediaObject, the state has returned to Phonon::LoadingState and the errorString() still returns an empty string (which may well be by design, of course).

kalarm(5627)/phonon (KDE plugin) Phonon::KioMediaStream::KioMediaStream:                            
kalarm(5627)/phonon (KDE plugin) Phonon::KioMediaStream::reset:                                     
kalarm(5627)/phonon (KDE plugin) Phonon::KioMediaStream::reset:                                     
kalarm(5627)/kio (Slave) KIO::Slave::createSlave: createSlave "file" for KUrl("file:///home/fanisatt/Swallows of April_fin.wav")                                               
kalarm(5627)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-david/kalarmTJ5627.slave-socket"                                                             
kalarm(5627)/kio (KIOJob) KIO::SlaveInterface::dispatch: error  111   "/home/fanisatt/Swallows of April_fin.wav"
kalarm(5627)/phonon (KDE plugin) Phonon::KioMediaStreamPrivate::_k_bytestreamResult: KIO Job error: "The file or folder /home/fanisatt/Swallows of April_fin.wav does not exist."
kalarm(5627)/phonon (KDE plugin) Phonon::KioMediaStreamPrivate::_k_bytestreamResult: KIO Job is done (will delete itself) and d->kiojob reset to 0
kalarm(5627) AudioThread::playStateChanged: STATE CHANGE -> 5
kalarm(5627) AudioThread::playStateChanged: ERROR: ""
Comment 1 David Jarvie 2009-04-26 15:52:39 UTC
It turns out that in the playStateChanged() slot which is triggered by MediaObject::stateChanged(), MediaObject::state() shows  Phonon::LoadingState and not Phonon::ErrorState when the text returned by MediaObject::errorString() is empty - even though the new state supplied as a parameter to the slot is Phonon::ErrorState.

This seems to indicate that the MediaObject state (and error text) changes between the time the signal is emitted and the slot being called. Note that in my application, the MediaObject is in the same thread as the playStateChanged() slot, so the problem seems to lie in Phonon and its threads.
Comment 2 Myriam Schweingruber 2009-11-08 16:49:23 UTC
Marked as JJ
Comment 3 Myriam Schweingruber 2010-04-06 09:30:03 UTC
Is this still valid for KDE SC 4.4.2?
Comment 4 Myriam Schweingruber 2010-07-19 14:51:25 UTC
Closing for lack of feedback. Please only reopen if this is reproducible in KDE SC 4.4.5 or later.