comparison libao2/ao_alsa.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 934380353fd6
children 401521ec0d61
comparison
equal deleted inserted replaced
17565:dc65faaadb04 17566:f580a7755ac5
235 tmp[0] = ','; 235 tmp[0] = ',';
236 while ((tmp = strrchr(dest, '='))) 236 while ((tmp = strrchr(dest, '=')))
237 tmp[0] = ':'; 237 tmp[0] = ':';
238 } 238 }
239 239
240 static void print_help () 240 static void print_help (void)
241 { 241 {
242 mp_msg (MSGT_AO, MSGL_FATAL, 242 mp_msg (MSGT_AO, MSGL_FATAL,
243 "\n-ao alsa commandline help:\n" 243 "\n-ao alsa commandline help:\n"
244 "Example: mplayer -ao alsa:mmap:device=hw=0.3\n" 244 "Example: mplayer -ao alsa:mmap:device=hw=0.3\n"
245 " sets mmap-mode and first card fourth device\n" 245 " sets mmap-mode and first card fourth device\n"
723 else { 723 else {
724 mp_msg(MSGT_AO,MSGL_ERR,"alsa-uninit: no handler defined!\n"); 724 mp_msg(MSGT_AO,MSGL_ERR,"alsa-uninit: no handler defined!\n");
725 } 725 }
726 } 726 }
727 727
728 static void audio_pause() 728 static void audio_pause(void)
729 { 729 {
730 int err; 730 int err;
731 731
732 if (alsa_can_pause) { 732 if (alsa_can_pause) {
733 if ((err = snd_pcm_pause(alsa_handler, 1)) < 0) 733 if ((err = snd_pcm_pause(alsa_handler, 1)) < 0)
743 return; 743 return;
744 } 744 }
745 } 745 }
746 } 746 }
747 747
748 static void audio_resume() 748 static void audio_resume(void)
749 { 749 {
750 int err; 750 int err;
751 751
752 if (alsa_can_pause) { 752 if (alsa_can_pause) {
753 if ((err = snd_pcm_pause(alsa_handler, 0)) < 0) 753 if ((err = snd_pcm_pause(alsa_handler, 0)) < 0)
764 } 764 }
765 } 765 }
766 } 766 }
767 767
768 /* stop playing and empty buffers (for seeking/pause) */ 768 /* stop playing and empty buffers (for seeking/pause) */
769 static void reset() 769 static void reset(void)
770 { 770 {
771 int err; 771 int err;
772 772
773 if ((err = snd_pcm_drop(alsa_handler)) < 0) 773 if ((err = snd_pcm_drop(alsa_handler)) < 0)
774 { 774 {
1028 1028
1029 return result; 1029 return result;
1030 } 1030 }
1031 1031
1032 /* how many byes are free in the buffer */ 1032 /* how many byes are free in the buffer */
1033 static int get_space() 1033 static int get_space(void)
1034 { 1034 {
1035 snd_pcm_status_t *status; 1035 snd_pcm_status_t *status;
1036 int ret; 1036 int ret;
1037 char *str_status; 1037 char *str_status;
1038 1038
1098 1098
1099 return(ret); 1099 return(ret);
1100 } 1100 }
1101 1101
1102 /* delay in seconds between first and last sample in buffer */ 1102 /* delay in seconds between first and last sample in buffer */
1103 static float get_delay() 1103 static float get_delay(void)
1104 { 1104 {
1105 1105
1106 if (alsa_handler) { 1106 if (alsa_handler) {
1107 1107
1108 snd_pcm_status_t *status; 1108 snd_pcm_status_t *status;