Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/multimedia/audio/qaudiooutput_mac_p.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    6161#include <QtCore/qdebug.h>
    6262
    63 #include <QtMultimedia/qaudiodeviceinfo.h>
    6463#include <QtMultimedia/qaudiooutput.h>
    6564
    6665#include "qaudio_mac_p.h"
    6766#include "qaudiooutput_mac_p.h"
     67
    6868
    6969
     
    279279        errorCode = QAudio::OpenError;
    280280    else {
     281
    281282        isOpen = false;
    282283        audioDeviceId = AudioDeviceID(did);
     
    300301QAudioOutputPrivate::~QAudioOutputPrivate()
    301302{
     303
    302304    close();
    303305}
     
    359361    streamFormat = toAudioStreamBasicDescription(audioFormat);
    360362
    361     UInt32 size = sizeof(deviceFormat);
    362     if (AudioUnitGetProperty(audioUnit,
    363                                 kAudioUnitProperty_StreamFormat,
    364                                 kAudioUnitScope_Input,
    365                                 0,
    366                                 &deviceFormat,
    367                                 &size) != noErr) {
    368         qWarning() << "QAudioOutput: Unable to retrieve device format";
    369         return false;
    370     }
    371 
     363    UInt32 size = sizeof(streamFormat);
    372364    if (AudioUnitSetProperty(audioUnit,
    373365                                kAudioUnitProperty_StreamFormat,
     
    393385    }
    394386
    395     periodSizeBytes = (numberOfFrames * streamFormat.mSampleRate / deviceFormat.mSampleRate) *
    396                         streamFormat.mBytesPerFrame;
     387    periodSizeBytes = numberOfFrames * streamFormat.mBytesPerFrame;
    397388    if (internalBufferSize < periodSizeBytes * 2)
    398389        internalBufferSize = periodSizeBytes * 2;
     
    436427    QIODevice*  op = device;
    437428
    438     if (!audioFormat.isValid() || !open()) {
     429    if (!audio) || !open()) {
    439430        stateCode = QAudio::StoppedState;
    440431        errorCode = QAudio::OpenError;
Note: See TracChangeset for help on using the changeset viewer.