Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/3rdparty/phonon/ds9/backend.cpp

    r2 r561  
    4242    namespace DS9
    4343    {
     44        QMutex *Backend::directShowMutex = 0;
     45
    4446        bool Backend::AudioMoniker::operator==(const AudioMoniker &other)
    4547        {
     
    5153            : QObject(parent)
    5254        {
    53                         ::CoInitialize(0);
     55            directShowMutex = &m_directShowMutex;
     56
     57            ::CoInitialize(0);
    5458
    5559            //registering meta types
     
    6266            m_audioOutputs.clear();
    6367            m_audioEffects.clear();
    64                         ::CoUninitialize();
     68            ::CoUninitialize();
     69
     70            directShowMutex = 0;
    6571        }
    6672
     
    132138        QList<int> Backend::objectDescriptionIndexes(Phonon::ObjectDescriptionType type) const
    133139        {
     140            QMutexLocker locker(&m_directShowMutex);
    134141            QList<int> ret;
    135142
     
    158165                        LPOLESTR str = 0;
    159166                        mon->GetDisplayName(0,0,&str);
    160                         const QString name = QString::fromUtf16((unsigned short*)str);
     167                        const QString name = QString::fromWCharArray(str);
    161168                                                ComPointer<IMalloc> alloc;
    162169                                                ::CoGetMalloc(1, alloc.pparam());
     
    205212        QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(Phonon::ObjectDescriptionType type, int index) const
    206213        {
     214            QMutexLocker locker(&m_directShowMutex);
    207215            QHash<QByteArray, QVariant> ret;
    208216            switch (type)
     
    217225                    HRESULT hr = mon->GetDisplayName(0,0, &str);
    218226                    if (SUCCEEDED(hr)) {
    219                         QString name = QString::fromUtf16((unsigned short*)str);
     227                        QString name = QString::fromWCharArray(str);
    220228                                                ComPointer<IMalloc> alloc;
    221229                                                ::CoGetMalloc(1, alloc.pparam());
     
    232240                    HRESULT hr = ::DMOGetName(m_audioEffects[index], name);
    233241                    if (SUCCEEDED(hr)) {
    234                         ret["name"] = QString::fromUtf16((unsigned short*)name);
     242                        ret["name"] = QString::fromWCharArray(name);
    235243                    }
    236244                }
Note: See TracChangeset for help on using the changeset viewer.