Previous 199869 Revisions Next

r20103 Sunday 6th January, 2013 at 14:17:04 UTC by Oliver Stöneberg
corrected comment and log message in parse_wav_sample() about channels / corrected some format specifiers (nw)
[src/lib/util]chdcd.c

trunk/src/lib/util/chdcd.c
r20102r20103
164164   if (offset < 4)
165165   {
166166      osd_close(file);
167      printf("ERROR: unexpected offset %d (%s)\n", actual, filename);
167      printf("ERROR: unexpected offset %lu (%s)\n", actual, filename);
168168      return 0;
169169   }
170170   if (memcmp(&buf[0], "RIFF", 4) != 0)
r20102r20103
180180   if (offset < 8)
181181   {
182182      osd_close(file);
183      printf("ERROR: unexpected offset %d (%s)\n", actual, filename);
183      printf("ERROR: unexpected offset %lu (%s)\n", actual, filename);
184184      return 0;
185185   }
186186   filesize = LITTLE_ENDIANIZE_INT32(filesize);
r20102r20103
191191   if (offset < 12)
192192   {
193193      osd_close(file);
194      printf("ERROR: unexpected offset %d (%s)\n", actual, filename);
194      printf("ERROR: unexpected offset %lu (%s)\n", actual, filename);
195195      return 0;
196196   }
197197   if (memcmp(&buf[0], "WAVE", 4) != 0)
r20102r20103
233233      return 0;
234234   }
235235
236   /* number of channels -- only mono is supported */
236   /* number of channels -- only stereo is supported */
237237   osd_read(file, &temp16, offset, 2, &actual);
238238   offset += actual;
239239   temp16 = LITTLE_ENDIANIZE_INT16(temp16);
240240   if (temp16 != 2)
241241   {
242242      osd_close(file);
243      printf("ERROR: unsupported number of channels %d - only mono is supported (%s)\n", temp16, filename);
243      printf("ERROR: unsupported number of channels %d - only stereo is supported (%s)\n", temp16, filename);
244244      return 0;
245245   }
246246
r20102r20103
251251   if (rate != 44100)
252252   {
253253      osd_close(file);
254      printf("ERROR: unsupported samplerate %d - only 44100 is supported (%s)\n", rate, filename);
254      printf("ERROR: unsupported samplerate %u - only 44100 is supported (%s)\n", rate, filename);
255255      return 0;
256256   }
257257

Previous 199869 Revisions Next


© 1997-2024 The MAME Team