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

List:       kde-commits
Subject:    KDE/kdebase/runtime/phonon/xine
From:       Ian Monroe <ian.monroe () gmail ! com>
Date:       2008-03-15 20:30:30
Message-ID: 1205613030.600911.13144.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 786017 by ianmonroe:

crash fix


 M  +15 -2     backend.cpp  
 M  +4 -1      xineengine.h  


--- trunk/KDE/kdebase/runtime/phonon/xine/backend.cpp #786016:786017
@@ -227,7 +227,10 @@
     case Phonon::AudioStreamType:
     case Phonon::SubtitleStreamType:
         {
-            list = XineEngine::objectDescriptions().find(type).value().keys();
+            ObjectDescriptionHash hash = XineEngine::objectDescriptions();
+            ObjectDescriptionHash::iterator it = hash.find(type);
+            if( it != hash.end() )
+                list = it.value().keys();
         }
         break;
     }
@@ -333,7 +336,17 @@
     case Phonon::AudioStreamType:
     case Phonon::SubtitleStreamType:
         {
-            ret = XineEngine::objectDescriptions().find(type).value().find(index).value();
 +            ObjectDescriptionHash descriptionHash = \
XineEngine::objectDescriptions(); +            ObjectDescriptionHash::iterator descIt \
= descriptionHash.find(type); +            if(descIt != descriptionHash.end())
+            {
+                ChannelIndexHash indexHash = descIt.value();
+                ChannelIndexHash::iterator indexIt = indexHash.find(index);
+                if(indexIt != indexHash.end() )
+                {
+                    ret = indexIt.value();
+                }
+            }
         }
         break;
     }
--- trunk/KDE/kdebase/runtime/phonon/xine/xineengine.h #786016:786017
@@ -60,6 +60,9 @@
 class XineEnginePrivate;
 class XineThread;
 
+typedef QHash< int, QHash<QByteArray, QVariant> > ChannelIndexHash;
+typedef QHash<ObjectDescriptionType, ChannelIndexHash> ObjectDescriptionHash;
+
 class XineEngine
 {
     friend class Phonon::Xine::Backend;
@@ -90,7 +93,7 @@
         static bool inShutdown() { return self()->m_inShutdown; }
 
         static void setObjectDescriptionProperities( ObjectDescriptionType type, int \
                index, const QHash<QByteArray, QVariant>& properities );
-        static QHash<ObjectDescriptionType, QHash< int, QHash<QByteArray, QVariant> \
> > objectDescriptions() { return self()->m_objectDescriptions; } +        static \
> > ObjectDescriptionHash objectDescriptions() { return self()->m_objectDescriptions; \
> > }
 
     protected:
         XineEngine(const KSharedConfigPtr &cfg);


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

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