comparison libao2/ao_esd.c @ 17566:f580a7755ac5

Patch by Stefan Huehner / stefan % huehner ! org \ patch replaces '()' for the correct '(void)' in function declarations/prototypes which have no parameters. The '()' syntax tell thats there is a variable list of arguments, so that the compiler cannot check this. The extra CFLAG '-Wstrict-declarations' shows those cases. Comments about a similar patch applied to ffmpeg: That in C++ these mean the same, but in ANSI C the semantics are different; function() is an (obsolete) K&R C style forward declaration, it basically means that the function can have any number and any types of parameters, effectively completely preventing the compiler from doing any sort of type checking. -- Erik Slagter Defining functions with unspecified arguments is allowed but bad. With arguments unspecified the compiler can't report an error/warning if the function is called with incorrect arguments. -- M\ns Rullg\rd
author rathann
date Thu, 09 Feb 2006 14:08:03 +0000
parents cae0dbeb44bb
children 6a08d0dabca8
comparison
equal deleted inserted replaced
17565:dc65faaadb04 17566:f580a7755ac5
344 344
345 345
346 /* 346 /*
347 * stop playing, keep buffers (for pause) 347 * stop playing, keep buffers (for pause)
348 */ 348 */
349 static void audio_pause() 349 static void audio_pause(void)
350 { 350 {
351 /* 351 /*
352 * not possible with esd. the esd daemom will continue playing 352 * not possible with esd. the esd daemom will continue playing
353 * buffered data (not more than ESD_MAX_DELAY seconds of samples) 353 * buffered data (not more than ESD_MAX_DELAY seconds of samples)
354 */ 354 */
356 356
357 357
358 /* 358 /*
359 * resume playing, after audio_pause() 359 * resume playing, after audio_pause()
360 */ 360 */
361 static void audio_resume() 361 static void audio_resume(void)
362 { 362 {
363 /* 363 /*
364 * not possible with esd. 364 * not possible with esd.
365 * 365 *
366 * Let's hope the pause was long enough that the esd ran out of 366 * Let's hope the pause was long enough that the esd ran out of
373 373
374 374
375 /* 375 /*
376 * stop playing and empty buffers (for seeking/pause) 376 * stop playing and empty buffers (for seeking/pause)
377 */ 377 */
378 static void reset() 378 static void reset(void)
379 { 379 {
380 #ifdef __svr4__ 380 #ifdef __svr4__
381 /* throw away data buffered in the esd connection */ 381 /* throw away data buffered in the esd connection */
382 if (ioctl(esd_play_fd, I_FLUSH, FLUSHW)) 382 if (ioctl(esd_play_fd, I_FLUSH, FLUSHW))
383 perror("I_FLUSH"); 383 perror("I_FLUSH");
386 386
387 387
388 /* 388 /*
389 * return: how many bytes can be played without blocking 389 * return: how many bytes can be played without blocking
390 */ 390 */
391 static int get_space() 391 static int get_space(void)
392 { 392 {
393 struct timeval tmout; 393 struct timeval tmout;
394 fd_set wfds; 394 fd_set wfds;
395 float current_delay; 395 float current_delay;
396 int space; 396 int space;
430 430
431 431
432 /* 432 /*
433 * return: delay in seconds between first and last sample in buffer 433 * return: delay in seconds between first and last sample in buffer
434 */ 434 */
435 static float get_delay() 435 static float get_delay(void)
436 { 436 {
437 struct timeval now; 437 struct timeval now;
438 double buffered_samples_time; 438 double buffered_samples_time;
439 double play_time; 439 double play_time;
440 440