Show
Ignore:
Timestamp:
08/31/07 01:56:53 (14 years ago)
Author:
ppalmers
Message:

- Fix file-based discovery. The previous code used a pointer to a

vendormodel entry. This pointer however pointed to a VendorModel?
object that was created on the stack of the discover function.
Hence the pointer becomes invalid when the discover function is
exited.

The changes incorporate using a VendorModelEntry? struct instead
of a pointer to it. So now the FFADODevice has it's own copy of
this struct, instead of a pointer to it.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/fireworks/fireworks_device.cpp

    r599 r607  
    6363    if ( vendorModel.parse() ) { 
    6464        vendorModel.printTable(); 
    65         return vendorModel.find( vendorId, modelId ); 
     65        return vendorModel.isPresent( vendorId, modelId ); 
    6666    } 
    6767 
     
    7575    unsigned int modelId = m_pConfigRom->getModelId(); 
    7676 
    77     GenericAVC::VendorModel vendorModel( SHAREDIR "/ffado_driver_bebob.txt" ); 
     77    GenericAVC::VendorModel vendorModel( SHAREDIR "/ffado_driver_fireworks.txt" ); 
    7878    if ( vendorModel.parse() ) { 
    7979        m_model = vendorModel.find( vendorId, modelId ); 
    8080    } 
    8181 
    82     if (m_model == NULL) { 
     82    if (!GenericAVC::VendorModel::isValid(m_model)) { 
    8383        return false; 
    8484    } 
    8585    debugOutput( DEBUG_LEVEL_VERBOSE, "found %s %s\n", 
    86             m_model->vendor_name.c_str(), m_model->model_name.c_str()); 
     86            m_model.vendor_name.c_str(), m_model.model_name.c_str()); 
    8787 
    8888    if ( !GenericAVC::AvDevice::discover() ) {