Changeset e7bf5f6 in mainline
- Timestamp:
- 2012-08-20T15:10:21Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- daed689
- Parents:
- 0387b92
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/dplay.c
r0387b92 re7bf5f6 91 91 ipc_callid_t callid = async_get_call(&call); 92 92 switch(IPC_GET_IMETHOD(call)) { 93 case PCM_EVENT_PLAYBACK_STARTED: 93 94 case PCM_EVENT_FRAMES_PLAYED: 94 95 printf("%u frames\n", IPC_GET_ARG1(call)); … … 128 129 assert(pb); 129 130 assert(pb->device); 130 pb->buffer.position = pb->buffer.base; 131 const size_t buffer_part = pb->buffer.size / BUFFER_PARTS; 132 pb->buffer.position = pb->buffer.base + buffer_part; 131 133 printf("Registering event callback\n"); 132 134 int ret = audio_pcm_register_event_callback(pb->device, … … 139 141 sampling_rate, pcm_sample_format_str(format), channels); 140 142 const size_t bytes = fread(pb->buffer.base, sizeof(uint8_t), 141 pb->buffer.size, pb->source);142 if (bytes != pb->buffer.size)143 bzero(pb->buffer.base + bytes, pb->buffer.size- bytes);143 buffer_part, pb->source); 144 if (bytes != buffer_part) 145 bzero(pb->buffer.base + bytes, buffer_part - bytes); 144 146 printf("Buffer data ready.\n"); 145 147 fibril_mutex_lock(&pb->mutex);
Note:
See TracChangeset
for help on using the changeset viewer.