Changeset bd5860f in mainline
- Timestamp:
- 2013-03-17T17:06:52Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b66d43b
- Parents:
- 9e1800c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/main.c
r9e1800c rbd5860f 51 51 static int hplay(const char *filename) 52 52 { 53 printf("HPLAY: %s\n", filename); 53 54 FILE *source = fopen(filename, "rb"); 54 if (!source) 55 if (!source) { 56 printf("Failed to open file %s\n", filename); 55 57 return EINVAL; 58 } 56 59 wave_header_t header; 57 60 size_t read = fread(&header, sizeof(header), 1, source); 58 if (read != sizeof(header)) { 61 if (read != 1) { 62 printf("Failed to read WAV header: %zu\n", read); 59 63 fclose(source); 60 64 return EIO; … … 85 89 } 86 90 static char buffer[BUFFER_SIZE]; 87 size_t size = 0; 88 while ((size = fread(buffer, sizeof(buffer), 1, source)) > 0) { 89 ret = hound_write_main_stream(hound, buffer, size); 91 while ((read = fread(buffer, sizeof(char), BUFFER_SIZE, source)) > 0) { 92 ret = hound_write_main_stream(hound, buffer, read); 90 93 if (ret != EOK) { 91 printf("Failed to write to context mainstream: %s\n",94 printf("Failed to write to main context stream: %s\n", 92 95 str_error(ret)); 93 96 break; … … 257 260 else 258 261 return play_hound(file); 259 (void)hplay;262 hplay(file); 260 263 } 261 264 /**
Note:
See TracChangeset
for help on using the changeset viewer.