Changeset 346643c in mainline for uspace/app/dplay/wave.c
- Timestamp:
- 2012-07-11T12:05:30Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 039337e8
- Parents:
- 94694a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/dplay/wave.c
r94694a4 r346643c 40 40 41 41 int wav_parse_header(void *file, const void **data, size_t *data_size, 42 unsigned * sampling_rate, unsigned *sample_size, unsigned *channels,43 bool *sign,const char **error)42 unsigned *channels, unsigned *sampling_rate, pcm_sample_format_t *format, 43 const char **error) 44 44 { 45 45 if (!file) { … … 86 86 } 87 87 88 88 89 if (data) 89 90 *data = header->data; … … 93 94 if (sampling_rate) 94 95 *sampling_rate = uint32_t_le2host(header->sampling_rate); 95 if (sample_size)96 *sample_size = uint32_t_le2host(header->sample_size);97 96 if (channels) 98 97 *channels = uint16_t_le2host(header->channels); 99 if (sign) 100 *sign = uint32_t_le2host(header->sample_size) == 16 101 ? true : false; 98 if (format) { 99 const unsigned size = uint32_t_le2host(header->sample_size); 100 switch (size) { 101 case 8: *format = PCM_SAMPLE_UINT8; break; 102 case 16: *format = PCM_SAMPLE_SINT16_LE; break; 103 case 24: *format = PCM_SAMPLE_SINT24_LE; break; 104 case 32: *format = PCM_SAMPLE_SINT32_LE; break; 105 default: 106 *error = "Unknown format"; 107 return ENOTSUP; 108 } 109 } 102 110 if (error) 103 111 *error = "no error";
Note:
See TracChangeset
for help on using the changeset viewer.