Changeset ac149d5 in mainline
- Timestamp:
- 2011-10-22T11:01:56Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b4857bc
- Parents:
- 5984107
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/sb16/dsp.c
r5984107 rac149d5 196 196 if (remain_size == 0) { 197 197 ddf_log_note("Nothing more to play"); 198 sb_dsp_write(dsp, DMA_16B_EXIT); 198 if (AUTO_DMA_MODE) { 199 sb_dsp_write(dsp, DMA_16B_EXIT); 200 } 199 201 sb_clear_buffer(dsp); 200 202 return; 201 203 } 202 if (remain_size < PLAY_BLOCK_SIZE) {204 if (remain_size <= PLAY_BLOCK_SIZE) { 203 205 ddf_log_note("Last %zu bytes to play.\n", remain_size); 204 206 /* This is the last block */ … … 264 266 const size_t play_size = 265 267 size < PLAY_BLOCK_SIZE ? size : PLAY_BLOCK_SIZE; 266 memcpy(dsp->buffer.data, dsp->playing.data, play_size);267 268 ddf_log_debug("Playing sound: %zu(%zu) bytes.\n", play_size, size); 268 const size_t copy_size = 269 size < BUFFER_SIZE ? size : BUFFER_SIZE; 270 269 271 270 272 dsp->playing.data = data; 271 dsp->playing.position = data + play_size;273 dsp->playing.position = data + copy_size; 272 274 dsp->playing.size = size; 273 275 dsp->playing.mode = 274 276 (bit_depth == 16 ? 0x10 : 0) | (channels == 2 ? 0x20 : 0); 275 276 277 ddf_log_debug("Setting mode %hhx.\n", dsp->playing.mode); 278 279 ddf_log_debug("Playing sound: %zu(%zu) bytes.\n", play_size, size); 280 memcpy(dsp->buffer.data, dsp->playing.data, copy_size); 281 277 282 sb_dsp_write(dsp, SET_SAMPLING_RATE_OUTPUT); 278 283 sb_dsp_write(dsp, sampling_rate >> 8);
Note:
See TracChangeset
for help on using the changeset viewer.