You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
phonon/phonon-4.3.2-kdebug#172242....

102 lines
3.3 KiB

Index: phonon/xine/xinestream.h
===================================================================
--- phonon/xine/xinestream.h (revision 924144)
+++ phonon/xine/xinestream.h (revision 924145)
@@ -86,7 +86,6 @@
//void needRewire(AudioPostList *postList);
void useGaplessPlayback(bool);
void useGapOf(int gap);
- void gaplessSwitchTo(const QUrl &url);
void gaplessSwitchTo(const QByteArray &mrl);
void closeBlocking();
void aboutToDeleteVideoWidget();
@@ -141,7 +140,6 @@
void unload();
public slots:
- void setUrl(const QUrl &url);
void setMrl(const QByteArray &mrl, StateForNewMrl = StoppedState);
void play();
void pause();
Index: phonon/xine/mediaobject.cpp
===================================================================
--- phonon/xine/mediaobject.cpp (revision 924144)
+++ phonon/xine/mediaobject.cpp (revision 924145)
@@ -317,6 +317,20 @@
setSourceInternal(source, HardSwitch);
}
+static QByteArray mrlEncode(QByteArray mrl)
+{
+ for (int i = 0; i < mrl.size(); ++i) {
+ const unsigned char c = static_cast<unsigned char>(mrl.at(i));
+ if (c & 0x80 || c == '\\' || c < 32 || c == '%') {
+ char enc[4];
+ qsnprintf(enc, 4, "%%%02X", c);
+ mrl = mrl.left(i) + QByteArray(enc, 3) + mrl.mid(i + 1);
+ i += 2;
+ }
+ }
+ return mrl;
+}
+
void MediaObject::setSourceInternal(const MediaSource &source, HowToSetTheUrl how)
{
//debug() << Q_FUNC_INFO;
@@ -340,13 +354,18 @@
m_stream->setError(Phonon::NormalError, tr("Cannot open media data at '<i>%1</i>'").arg(source.url().toString(QUrl::RemovePassword)));
return;
}
- switch (how) {
- case GaplessSwitch:
- m_stream->gaplessSwitchTo(source.url());
- break;
- case HardSwitch:
- m_stream->setUrl(source.url());
- break;
+ {
+ const QByteArray &mrl = (source.url().scheme() == QLatin1String("file") ?
+ "file:/" + mrlEncode(QFile::encodeName(source.url().toLocalFile())) :
+ source.url().toEncoded());
+ switch (how) {
+ case GaplessSwitch:
+ m_stream->gaplessSwitchTo(mrl);
+ break;
+ case HardSwitch:
+ m_stream->setMrl(mrl);
+ break;
+ }
}
break;
case MediaSource::Disc:
Index: phonon/xine/xinestream.cpp
===================================================================
--- phonon/xine/xinestream.cpp (revision 924144)
+++ phonon/xine/xinestream.cpp (revision 924145)
@@ -619,12 +619,6 @@
}
// called from main thread
-void XineStream::gaplessSwitchTo(const QUrl &url)
-{
- gaplessSwitchTo(url.toEncoded());
-}
-
-// called from main thread
void XineStream::gaplessSwitchTo(const QByteArray &mrl)
{
QCoreApplication::postEvent(this, new GaplessSwitchEvent(mrl));
@@ -1707,12 +1701,6 @@
}
// called from main thread
-void XineStream::setUrl(const QUrl &url)
-{
- setMrl(url.toEncoded());
-}
-
-// called from main thread
void XineStream::setMrl(const QByteArray &mrl, StateForNewMrl sfnm)
{
debug() << Q_FUNC_INFO << mrl << ", " << sfnm;