Fork us on GitHub Follow us on Facebook Follow us on Twitter

Ignore:
Timestamp:
2012-07-17T06:53:55Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial
Children:
950110ee
Parents:
bb67def
Message:

hound: Check format before starting playback.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/audio_device.c

    rbb67def r389ef25  
    5151static int device_source_connection_callback(audio_source_t *source);
    5252static void device_event_callback(ipc_callid_t iid, ipc_call_t *icall, void *arg);
     53static int device_check_format(audio_sink_t* sink);
    5354static int get_buffer(audio_device_t *dev);
    5455static int release_buffer(audio_device_t *dev);
     
    6869
    6970        audio_sink_init(&dev->sink, name, dev, device_sink_connection_callback,
    70             &AUDIO_FORMAT_ANY);
     71            device_check_format, &AUDIO_FORMAT_ANY);
    7172        audio_source_init(&dev->source, name, dev,
    7273            device_source_connection_callback, NULL, &AUDIO_FORMAT_ANY);
     
    222223        }
    223224}
     225static int device_check_format(audio_sink_t* sink)
     226{
     227        assert(sink);
     228        audio_device_t *dev = sink->private_data;
     229        assert(dev);
     230        log_verbose("Checking format on sink %s", sink->name);
     231        return audio_pcm_test_format(dev->sess, &sink->format.channels,
     232            &sink->format.sampling_rate, &sink->format.sample_format);
     233}
    224234
    225235static int get_buffer(audio_device_t *dev)
Note: See TracChangeset for help on using the changeset viewer.