[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    PATCH: noatun wavs without mpeglib
From:       Stefan Westerfeld <stefan () space ! twc ! de>
Date:       2001-01-26 10:40:49
[Download RAW message or body]

Hi!

Not all platforms that kde ships on will support threading and consequently
not all of them will have mpeglib installed. So noatun should not hardcode
to always use the mpeglib PlayObject for wavs, but prefer it when available.

Would be nice if any noatun developer reviewed/tested this (haven't tested
it yet).

   Cu... Stefan
-- 
  -* Stefan Westerfeld, stefan@space.twc.de (PGP!), Hamburg/Germany
     KDE Developer, project infos at http://space.twc.de/~stefan/kde *-         

["20010126-noatun-no-mpeglib-nb.diff" (text/plain)]

Index: engine.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/noatun/noatun/library/engine.cpp,v
retrieving revision 1.36
diff -u -b -r1.36 engine.cpp
--- engine.cpp	2001/01/25 21:27:58	1.36
+++ engine.cpp	2001/01/26 10:28:58
@@ -99,12 +99,6 @@
 {
 	string objectType;
 
-	if (file->mimetype()=="audio/x-wav")
-	{ // Don't cache wavs
-		objectType="WAVPlayObject";
-	}
-	else
-	{
 		TraderQuery query;
 		query.supports("Interface","Arts::PlayObject");
 		query.supports("MimeType", std::string(file->mimetype()));
@@ -113,8 +107,13 @@
 		if(!offers->empty())
 			objectType = offers->front().interfaceName();
 
+	// prefer WAVPlayObject when available (don't cache wavs)
+	vector<TraderOffer>::iterator i;
+	for(i = offers->begin(); i != offers->end(); i++)
+		if(i->interfaceName() == "WAVPlayObject")
+			objectType = i->interfaceName();
+
 		delete offers;
-	}
 
 	return objectType;
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic