Changeset 1289

Show
Ignore:
Timestamp:
07/10/08 17:14:31 (13 years ago)
Author:
jwoithe
Message:

MOTU: getSupportedSamplingFrequencies(): not all MOTUs support all sample rates, so only return frequencies that the current device actually supports.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/src/motu/motu_avdevice.cpp

    r1288 r1289  
    829829{ 
    830830    std::vector<int> frequencies; 
     831    signed int max_freq = DevicesProperty[m_motu_model-1].MaxSampleRate; 
     832 
     833    /* All MOTUs support 1x rates.  All others must be conditional. */ 
    831834    frequencies.push_back(44100); 
    832835    frequencies.push_back(48000); 
    833     frequencies.push_back(88200); 
    834     frequencies.push_back(96000); 
    835     frequencies.push_back(176400); 
    836     frequencies.push_back(192000); 
     836 
     837    if (88200 <= max_freq) 
     838        frequencies.push_back(88200); 
     839    if (96000 <= max_freq) 
     840        frequencies.push_back(96000); 
     841    if (176400 <= max_freq) 
     842        frequencies.push_back(176400); 
     843    if (192000 <= max_freq) 
     844        frequencies.push_back(192000); 
    837845    return frequencies; 
    838846}