- fix Source0 Url

- xine backend will not play files with non-ascii names (kdebug#172242)
epel9
Rex Dieter 16 years ago
parent 0a1f4e12e2
commit 508e5f278b

@ -0,0 +1,101 @@
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;

@ -1,11 +1,12 @@
Summary: Multimedia framework api
Name: phonon
Version: 4.3.1
Release: 3%{?dist}
Release: 4%{?dist}
Group: System Environment/Libraries
License: LGPLv2+
URL: http://phonon.kde.org/
Source0: ftp://ftp.kde.org/pub/kde/stable/phonon/%{version}/%{name}-%{version}.tar.bz2
#Source0: ftp://ftp.kde.org/pub/kde/stable/phonon/%{version}/%{name}-%{version}.tar.bz2
Source0: ftp://ftp.kde.org/pub/kde/stable/4.2.1/phonon-%{version}.tar.bz2
Source1: http://gstreamer.freedesktop.org/data/images/artwork/gstreamer-logo.svg
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -21,6 +22,8 @@ Patch1: phonon-4.2.96-xine-pulseaudio.patch
## Upstream patches
Patch100: phonon-4.3.2-gstreamer-utf8-url.patch
Patch101: phonon-4.3.2-gstreamer-volumefader.patch
# fix for non-ascii filenames in xine backend
Patch102: phonon-4.3.2-kdebug#172242.patch
BuildRequires: automoc4 >= 0.9.86
BuildRequires: cmake >= 2.6.0
@ -76,6 +79,7 @@ Requires: pkgconfig
%patch1 -p1 -b .xine-pulseaudio
%patch100 -p0 -b .gstreamer-utf8-url
%patch101 -p0 -b .gstreamer-volumefader
%patch102 -p1 -b .xine_nonascii
%build
@ -168,6 +172,10 @@ fi
%changelog
* Mon May 04 2009 Rex Dieter <rdieter@fedoraproject.org> - 4.3.1-4
- fix Source0 Url
- xine backend will not play files with non-ascii names (kdebug#172242)
* Sat Apr 11 2009 Rex Dieter <rdieter@fedoraproject.org> - 4.3.1-3
- optimize scriptlets
- Provides/Requires: phonon-backend%%{_isa} ...

Loading…
Cancel
Save