Changeset d2765ab3 in mainline


Ignore:
Timestamp:
2012-08-19T13:45:54Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d758301
Parents:
ff396ea
Message:

sb16: Use format test function to validate input parameters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/dsp.c

    rff396ea rd2765ab3  
    336336        ddf_log_debug("Requested playback: %u frames, %uHz, %s, %u channel(s).",
    337337            frames, sampling_rate, pcm_sample_format_str(format), channels);
    338         if (channels != 1 && channels != 2)
    339                 return ENOTSUP;
    340         if (sampling_rate > DSP_RATE_LIMIT)
    341                 return ENOTSUP;
    342         // FIXME We only support 16 bit playback
    343         if (format != PCM_SAMPLE_UINT16_LE && format != PCM_SAMPLE_SINT16_LE)
     338        if (sb_dsp_test_format(dsp, &channels, &sampling_rate, &format) != EOK)
    344339                return ENOTSUP;
    345340
     
    408403        ddf_log_debug("Requested record: %u frames, %uHz, %s, %u channel(s).",
    409404            frames, sampling_rate, pcm_sample_format_str(format), channels);
    410         if (channels != 1 && channels != 2)
    411                 return ENOTSUP;
    412         if (sampling_rate > DSP_RATE_LIMIT)
    413                 return ENOTSUP;
    414         // FIXME We only support 16 bit recording
    415         if (format != PCM_SAMPLE_UINT16_LE && format != PCM_SAMPLE_SINT16_LE)
     405        if (sb_dsp_test_format(dsp, &channels, &sampling_rate, &format) != EOK)
    416406                return ENOTSUP;
    417407
Note: See TracChangeset for help on using the changeset viewer.