| Summary: | ability to play SMIL playlists | ||
|---|---|---|---|
| Product: | [Applications] amarok | Reporter: | Matej Cepl <mcepl> |
| Component: | general | Assignee: | Amarok Bugs <amarok-bugs-null> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Debian testing | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Lame attempt for the patch resolving the issue
output of amarok 2>&1 | tee wgbh-jazz-log.txt |
||
|
Description
Matej Cepl
2006-02-14 23:25:35 UTC
Created attachment 14766 [details] Lame attempt for the patch resolving the issue Thread for this patch is http://comments.gmane.org/gmane.comp.kde.amarok.devel/5080 Actually, the original stream is http://streams.wgbh.org/blues/blues.ram which really leads to http://streams.wgbh.org/blues/blues.smil?mode="compact" SVN commit 518214 by seb:
Support for SMIL playlists. Needs testing.
Matej: before submitting a patch, please test that it works.
BUG: 121983
M +1 -0 ChangeLog
M +55 -1 src/playlistloader.cpp
M +3 -1 src/playlistloader.h
--- trunk/extragear/multimedia/amarok/ChangeLog #518213:518214
@@ -5,6 +5,7 @@
VERSION 1.4-beta3:
FEATURES:
+ * Support for SMIL playlists. (BR 121983)
* Support for WAX playlists. (BR 120980)
* Handle the Year tag when playing AudioCDs. Patch by Markus Kaufhold
<M.Kaufhold@gmx.de>. (BR 123428)
--- trunk/extragear/multimedia/amarok/src/playlistloader.cpp #518213:518214
@@ -3,6 +3,7 @@
// .ram file support from Kaffeine 0.5, Copyright (C) 2004 by Jürgen Kofler (GPL 2 or later)
// .asx file support added by Michael Seiwert Copyright (C) 2006
// .asx file support from Kaffeine, Copyright (C) 2004-2005 by Jürgen Kofler (GPL 2 or later)
+// .smil file support from Kaffeine 0.7
// .pls parser (C) Copyright 2005 by Michael Buesch <mbuesch@freenet.de>
// Copyright: See COPYING file that comes with this distribution
//
@@ -539,6 +540,7 @@
return;
case RAM: loadRealAudioRam( stream ); break;
case ASX: loadASX( stream ); break;
+ case SMIL: loadSMIL( stream ); break;
default:
m_error = i18n( "amaroK does not support this playlist format." );
return;
@@ -759,7 +761,7 @@
stream.setEncoding( QTextStream::UnicodeUTF8 );
if (!doc.setContent(stream.read(), &errorMsg, &errorLine, &errorColumn))
{
- kdError() << "[PLAYLISTLOADER]: Error loading xml file: " "(" << errorMsg << ")"
+ debug() << "[PLAYLISTLOADER]: Error loading xml file: " "(" << errorMsg << ")"
<< " at line " << errorLine << ", column " << errorColumn << endl;
return false;
}
@@ -840,6 +842,58 @@
return true;
}
+bool
+PlaylistFile::loadSMIL( QTextStream &stream )
+{
+ // adapted from Kaffeine 0.7
+ QDomDocument doc;
+ if( !doc.setContent( stream.read() ) )
+ {
+ debug() << "Could now read smil playlist" << endl;
+ return false;
+ }
+ QDomElement root = doc.documentElement();
+ stream.setEncoding ( QTextStream::UnicodeUTF8 );
+
+ if( root.nodeName().lower() != "smil" )
+ return false;
+
+ KURL kurl;
+ QString url;
+ QDomNodeList nodeList;
+ QDomNode node;
+ QDomElement element;
+
+ //audio sources...
+ nodeList = doc.elementsByTagName( "audio" );
+ for( uint i = 0; i < nodeList.count(); i++ )
+ {
+ MetaBundle b;
+ node = nodeList.item(i);
+ url = QString::null;
+ if( (node.nodeName().lower() == "audio") && (node.isElement()) )
+ {
+ element = node.toElement();
+ if( element.hasAttribute("src") )
+ url = element.attribute("src");
+
+ else if( element.hasAttribute("Src") )
+ url = element.attribute("Src");
+
+ else if( element.hasAttribute("SRC") )
+ url = element.attribute("SRC");
+ }
+ if( !url.isNull() )
+ {
+ b.setUrl( url );
+ m_bundles += b;
+ }
+ }
+
+ return true;
+}
+
+
/// @class RemotePlaylistFetcher
#include <ktempfile.h>
--- trunk/extragear/multimedia/amarok/src/playlistloader.h #518213:518214
@@ -38,7 +38,7 @@
public:
PlaylistFile( const QString &path );
- enum Format { M3U, PLS, XML, RAM, ASX, Unknown, NotPlaylist = Unknown };
+ enum Format { M3U, PLS, XML, RAM, SMIL, ASX, Unknown, NotPlaylist = Unknown };
/// the bundles from this playlist, they only contain
/// the information that can be extracted from the playlists
@@ -63,6 +63,7 @@
unsigned int loadPls_extractIndex( const QString &str ) const;
bool loadRealAudioRam( QTextStream& );
bool loadASX( QTextStream& );
+ bool loadSMIL( QTextStream& );
QString m_path;
QString m_error;
BundleList m_bundles;
@@ -76,6 +77,7 @@
if( ext == "m3u" ) return M3U;
if( ext == "pls" ) return PLS;
if( ext == "ram" ) return RAM;
+ if( ext == "smil") return SMIL;
if( ext == "asx" || ext == "wax" ) return ASX;
if( ext == "xml" ) return XML;
This doesn't work (see output of stderr when trying to open http://streams.wgbh.org/scripts/smil.php?showName=jazz). Created attachment 15100 [details]
output of amarok 2>&1 | tee wgbh-jazz-log.txt
What's up with this report, can we close it? I thought SMIL support was implemented. As I see it, Sub tried to implement my patch (comment #3), but it didn't work (comments #5 and #6), so IMHO this bug is still alive and kicking (as my fellow Bostonian speak about lobsters :-)). Checking amarok 1.4-beta3 and this stream http://streams.wgbh.org/scripts/smil.php?showName=jazz leads to "No demux plugin available: check your installation". |