Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/wavplay/drec.c

    r33b8d024 r0e4c5f0  
    4242#include <as.h>
    4343#include <inttypes.h>
    44 #include <str.h>
    4544
    4645#include "wave.h"
     
    140139        assert(rec);
    141140        assert(rec->device);
    142         errno_t ret = audio_pcm_register_event_callback(rec->device,
     141        int ret = audio_pcm_register_event_callback(rec->device,
    143142            device_event_callback, rec);
    144143        if (ret != EOK) {
     
    171170 * @param device The device.
    172171 * @param file The file.
    173  * @return 0 on succes, non-zero on failure.
     172 * @return Error code.
    174173 */
    175174int drecord(const char *device, const char *file)
    176175{
    177         errno_t ret = EOK;
     176        int ret = EOK;
    178177        audio_pcm_sess_t *session = NULL;
    179         sysarg_t val;
    180178        if (str_cmp(device, "default") == 0) {
    181179                session = audio_pcm_open_default();
     
    188186        }
    189187        printf("Recording on device: %s.\n", device);
    190         ret = audio_pcm_query_cap(session, AUDIO_CAP_CAPTURE, &val);
    191         if (ret != EOK || !val) {
     188        if (audio_pcm_query_cap(session, AUDIO_CAP_CAPTURE) <= 0) {
    192189                printf("Device %s does not support recording\n", device);
    193190                ret = ENOTSUP;
     
    195192        }
    196193
    197         char* info = NULL;
     194        const char* info = NULL;
    198195        ret = audio_pcm_get_info_str(session, &info);
    199196        if (ret != EOK) {
     
    228225                goto cleanup;
    229226        }
    230         ret = audio_pcm_query_cap(rec.device, AUDIO_CAP_INTERRUPT, &val);
    231         if (ret == EOK && val)
     227        if (audio_pcm_query_cap(rec.device, AUDIO_CAP_INTERRUPT) > 0)
    232228                record_fragment(&rec, format);
    233229        else
Note: See TracChangeset for help on using the changeset viewer.