Ticket #25831: patch-qaudio-format-converters.diff

File patch-qaudio-format-converters.diff, 1.8 KB (added by sharky@…, 14 years ago)
  • src/multimedia/audio/qaudio_mac.cpp

    From b82ed43086aebb4698a8a52965eeb17349ef1d04 Mon Sep 17 00:00:00 2001
    From: Justin McPherson <justin.mcpherson@nokia.com>
    Date: Mon, 21 Jun 2010 15:11:59 +1000
    Subject: [PATCH] Audio(osx); Fix audio format converters.
    
    Reviewed-by:Dmytro Poplavskiy
    ---
     src/multimedia/audio/qaudio_mac.cpp |    9 ++++++---
     1 files changed, 6 insertions(+), 3 deletions(-)
    
    diff --git a/src/multimedia/audio/qaudio_mac.cpp b/src/multimedia/audio/qaudio_mac.cpp
    index 14fee8b..4e17b52 100644
    QAudioFormat toQAudioFormat(AudioStreamBasicDescription const& sf) 
    6868    audioFormat.setChannels(sf.mChannelsPerFrame);
    6969    audioFormat.setSampleSize(sf.mBitsPerChannel);
    7070    audioFormat.setCodec(QString::fromLatin1("audio/pcm"));
    71     audioFormat.setByteOrder(sf.mFormatFlags & kLinearPCMFormatFlagIsBigEndian != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian);
     71    audioFormat.setByteOrder((sf.mFormatFlags & kAudioFormatFlagIsBigEndian) != 0 ? QAudioFormat::BigEndian : QAudioFormat::LittleEndian);
    7272    QAudioFormat::SampleType type = QAudioFormat::UnSignedInt;
    73     if ((sf.mFormatFlags & kLinearPCMFormatFlagIsSignedInteger) != 0)
     73    if ((sf.mFormatFlags & kAudioFormatFlagIsSignedInteger) != 0)
    7474        type = QAudioFormat::SignedInt;
    75     else if ((sf.mFormatFlags & kLinearPCMFormatFlagIsFloat) != 0)
     75    else if ((sf.mFormatFlags & kAudioFormatFlagIsFloat) != 0)
    7676        type = QAudioFormat::Float;
    7777    audioFormat.setSampleType(type);
    7878
    AudioStreamBasicDescription toAudioStreamBasicDescription(QAudioFormat const& au 
    9999    case QAudioFormat::Unknown:  default: break;
    100100    }
    101101
     102    if (audioFormat.byteOrder() == QAudioFormat::BigEndian)
     103        sf.mFormatFlags |= kAudioFormatFlagIsBigEndian;
     104
    102105    return sf;
    103106}
    104107