[Mplayer-cvslog] CVS: main/libao2 ao_alsa5.c,1.12,1.13 ao_alsa9.c,1.25,1.26 ao_oss.c,1.32,1.33 ao_sdl.c,1.20,1.21 ao_sun.c,1.22,1.23

Arpi of Ize arpi at mplayerhq.hu
Fri Nov 1 18:47:15 CET 2002


Update of /cvsroot/mplayer/main/libao2
In directory mail:/var/tmp.root/cvs-serv20982/libao2

Modified Files:
	ao_alsa5.c ao_alsa9.c ao_oss.c ao_sdl.c ao_sun.c 
Log Message:
verbose can be negative


Index: ao_alsa5.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa5.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ao_alsa5.c	7 Oct 2002 19:56:26 -0000	1.12
+++ ao_alsa5.c	1 Nov 2002 17:46:42 -0000	1.13
@@ -17,8 +17,6 @@
 
 #include "../mp_msg.h"
 
-extern int verbose;
-
 static ao_info_t info = 
 {
     "ALSA-0.5.x audio output",

Index: ao_alsa9.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_alsa9.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- ao_alsa9.c	7 Oct 2002 19:21:35 -0000	1.25
+++ ao_alsa9.c	1 Nov 2002 17:46:42 -0000	1.26
@@ -212,7 +212,7 @@
 
     alsa_handler = NULL;
 
-    if (verbose)
+    if (verbose>0)
 	printf("alsa-init: compiled for ALSA-%s\n", SND_LIB_VERSION_STR);
 
     if ((err = snd_card_next(&cards)) < 0 || cards < 0)
@@ -357,7 +357,7 @@
 	sprintf(devstr, "iec958:AES0=0x%x,AES1=0x%x,AES2=0x%x,AES3=0x%x", 
 		s[0], s[1], s[2], s[3]);
 
-	if (verbose)
+	if (verbose>0)
 	  printf("alsa-spdif-init: playing AC3, %i channels\n", channels);
 	break;
       case 4:
@@ -404,7 +404,7 @@
 	    return(0);
 	  }
 	
-	if (verbose)
+	if (verbose>0)
 	  printf("alsa-init: got device=%i, subdevice=%i\n", tmp_device, tmp_subdevice);
 
 	if ((err = snprintf(alsa_device, ALSA_DEVICE_SIZE, "hw:%1d,%1d", tmp_device, tmp_subdevice)) <= 0)
@@ -446,7 +446,7 @@
 	case 1:
 	  alsa_fragcount = 16;
 	  chunk_size = 512;
-	  if (verbose) {
+	  if (verbose>0) {
 	    printf("alsa-init: buffersize set manually to 8192\n");
 	    printf("alsa-init: chunksize set manually to 512\n");
 	  }
@@ -454,7 +454,7 @@
 	case 2:
 	  alsa_fragcount = 8;
 	  chunk_size = 1024;
-	  if (verbose) {
+	  if (verbose>0) {
 	    printf("alsa-init: buffersize set manually to 8192\n");
 	    printf("alsa-init: chunksize set manually to 1024\n");
 	  }
@@ -462,7 +462,7 @@
 	case 3:
 	  alsa_fragcount = 32;
 	  chunk_size = 512;
-	  if (verbose) {
+	  if (verbose>0) {
 	    printf("alsa-init: buffersize set manually to 16384\n");
 	    printf("alsa-init: chunksize set manually to 512\n");
 	  }
@@ -470,7 +470,7 @@
 	case 4:
 	  alsa_fragcount = 16;
 	  chunk_size = 1024;
-	  if (verbose) {
+	  if (verbose>0) {
 	    printf("alsa-init: buffersize set manually to 16384\n");
 	    printf("alsa-init: chunksize set manually to 1024\n");
 	  }
@@ -507,7 +507,7 @@
       if ((err = snd_pcm_nonblock(alsa_handler, set_block_mode)) < 0) {
 	printf("alsa-init: error set block-mode %s\n", snd_strerror(err));
       }
-      else if (verbose) {
+      else if (verbose>0) {
 	printf("alsa-init: pcm opend in %s\n", str_block_mode);
       }
       
@@ -580,7 +580,7 @@
 		   snd_strerror(err));
 	    return(0);
 	  }
-	if (verbose)
+	if (verbose>0)
 	  printf("alsa-init: buffer_time: %d, period_time :%d\n",alsa_buffer_time, err);
       }
 #endif
@@ -593,7 +593,7 @@
 	    printf("alsa-init: unable to set periodsize: %s\n", snd_strerror(err));
 	    return(0);
 	  }
-	else if (verbose) {
+	else if (verbose>0) {
 	  printf("alsa-init: chunksize set to %i\n", chunk_size);
 	}
 
@@ -602,7 +602,7 @@
 	  alsa_fragcount = period_val;			
 	}
 
-	if (verbose)
+	if (verbose>0)
 	  printf("alsa-init: current val=%i, fragcount=%i\n", period_val, alsa_fragcount);
 
 	if ((err = snd_pcm_hw_params_set_periods(alsa_handler, alsa_hwparams, alsa_fragcount, 0)) < 0) {
@@ -629,7 +629,7 @@
 	}
       else {
 	ao_data.buffersize = err;
-	if (verbose)
+	if (verbose>0)
 	  printf("alsa-init: got buffersize=%i\n", ao_data.buffersize);
       }
 
@@ -661,7 +661,7 @@
 	  bits_per_frame = bits_per_sample * channels;
 	  chunk_bytes = chunk_size * bits_per_frame / 8;
 
-	  if (verbose) {
+	  if (verbose>0) {
 	    printf("alsa-init: bits per sample (bps)=%i, bits per frame (bpf)=%i, chunk_bytes=%i\n",bits_per_sample,bits_per_frame,chunk_bytes);}
 
 	}//end swparams
@@ -725,7 +725,7 @@
 	}
     }
     else {
-      if (verbose)
+      if (verbose>0)
 	printf("alsa-pause: paused nonblock\n");
 
       return;
@@ -762,7 +762,7 @@
 	  return;
 	}
     } else {
-      if (verbose)
+      if (verbose>0)
 	printf("alsa-reset: reset nonblocked");
       return;
     }
@@ -1051,7 +1051,7 @@
 	str_status = "running";
       break;
     case SND_PCM_STATE_PAUSED:
-      if (verbose) printf("alsa-space: paused");
+      if (verbose>0) printf("alsa-space: paused");
       str_status = "paused";
       ret = 0;
       break;
@@ -1069,7 +1069,7 @@
       }
     }
 
-    if (verbose && str_status != "running")
+    if (verbose>0 && str_status != "running")
       printf("alsa-space: free space = %i, status=%i, %s --\n", ret, status, str_status);
     snd_pcm_status_free(status);
     

Index: ao_oss.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- ao_oss.c	8 Oct 2002 22:41:45 -0000	1.32
+++ ao_oss.c	1 Nov 2002 17:46:42 -0000	1.33
@@ -20,8 +20,6 @@
 #include "audio_out.h"
 #include "audio_out_internal.h"
 
-extern int verbose;
-
 static ao_info_t info = 
 {
 	"OSS/ioctl audio output",

Index: ao_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sdl.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ao_sdl.c	25 Oct 2002 10:27:20 -0000	1.20
+++ ao_sdl.c	1 Nov 2002 17:46:42 -0000	1.21
@@ -13,6 +13,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "../config.h"
+#include "../mp_msg.h"
+
 #include "audio_out.h"
 #include "audio_out_internal.h"
 #include "afmt.h"
@@ -30,9 +33,6 @@
 
 LIBAO_EXTERN(sdl)
 
-
-extern int verbose;
-
 // Samplesize used by the SDLlib AudioSpec struct
 #define SAMPLESIZE 1024
 
@@ -153,11 +153,11 @@
 	/* Allocate ring-buffer memory */
 	for(i=0;i<NUM_BUFS;i++) buffer[i]=(unsigned char *) malloc(BUFFSIZE);
 
-	printf("SDL: Samplerate: %iHz Channels: %s Format %s\n", rate, (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
+	mp_msg(MSGT_AO,MSGL_INFO,"SDL: Samplerate: %iHz Channels: %s Format %s\n", rate, (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format));
 
 	if(ao_subdevice) {
 		setenv("SDL_AUDIODRIVER", ao_subdevice, 1);
-		printf("SDL: using %s audio driver\n", ao_subdevice);
+		mp_msg(MSGT_AO,MSGL_INFO,"SDL: using %s audio driver\n", ao_subdevice);
 	}
 
 	ao_data.channels=channels;
@@ -189,7 +189,7 @@
 		aspec.format = AUDIO_U16MSB;
 	    break;
 	    default:
-                printf("SDL: Unsupported audio format: 0x%x.\n", format);
+                mp_msg(MSGT_AO,MSGL_WARN,"SDL: Unsupported audio format: 0x%x.\n", format);
                 return 0;
 	}
 
@@ -211,13 +211,13 @@
 
 	/* initialize the SDL Audio system */
         if (SDL_Init (SDL_INIT_AUDIO/*|SDL_INIT_NOPARACHUTE*/)) {
-                printf("SDL: Initializing of SDL Audio failed: %s.\n", SDL_GetError());
+                mp_msg(MSGT_AO,MSGL_ERR,"SDL: Initializing of SDL Audio failed: %s.\n", SDL_GetError());
                 return 0;
         }
 
 	/* Open the audio device and start playing sound! */
 	if(SDL_OpenAudio(&aspec, &obtained) < 0) {
-        	printf("SDL: Unable to open audio: %s\n", SDL_GetError());
+        	mp_msg(MSGT_AO,MSGL_ERR,"SDL: Unable to open audio: %s\n", SDL_GetError());
         	return(0);
 	} 
 
@@ -245,11 +245,11 @@
 		ao_data.format = AFMT_U16_BE;
 	    break;
 	    default:
-                printf("SDL: Unsupported SDL audio format: 0x%x.\n", obtained.format);
+                mp_msg(MSGT_AO,MSGL_WARN,"SDL: Unsupported SDL audio format: 0x%x.\n", obtained.format);
                 return 0;
 	}
 
-	if(verbose) printf("SDL: buf size = %d\n",obtained.size);
+	mp_msg(MSGT_AO,MSGL_V,"SDL: buf size = %d\n",obtained.size);
 	ao_data.buffersize=obtained.size;
 	
 	/* unsilence audio, if callback is ready */
@@ -260,7 +260,7 @@
 
 // close audio device
 static void uninit(){
-	if(verbose) printf("SDL: Audio Subsystem shutting down!\n");
+	mp_msg(MSGT_AO,MSGL_V,"SDL: Audio Subsystem shutting down!\n");
 	SDL_CloseAudio();
 	SDL_QuitSubSystem(SDL_INIT_AUDIO);
 }

Index: ao_sun.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sun.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ao_sun.c	11 Oct 2002 21:22:55 -0000	1.22
+++ ao_sun.c	1 Nov 2002 17:46:42 -0000	1.23
@@ -125,19 +125,19 @@
     info.play.encoding = AUDIO_ENCODING_LINEAR;
     info.play.samples = 0;
     if (ioctl(fd, AUDIO_SETINFO, &info)) {
-	if (verbose)
+	if (verbose>0)
 	    printf("rtsc: SETINFO failed\n");
 	goto error;
     }
     
     if (write(fd, silence, len) != len) {
-	if (verbose)
+	if (verbose>0)
 	    printf("rtsc: write failed");
 	goto error;
     }
 
     if (ioctl(fd, AUDIO_GETINFO, &info)) {
-	if (verbose)
+	if (verbose>0)
 	    perror("rtsc: GETINFO1");
 	goto error;
     }
@@ -159,18 +159,18 @@
 	    break;
 
 	if (ioctl(fd, AUDIO_GETINFO, &info)) {
-	    if (verbose)
+	    if (verbose>0)
 		perror("rtsc: GETINFO2 failed");
 	    goto error;
 	}
 	if (info.play.samples < last_samplecnt) {
-	    if (verbose)
+	    if (verbose>0)
 		printf("rtsc: %d > %d?\n", last_samplecnt, info.play.samples);
 	    goto error;
 	}
 
 	if ((increment = info.play.samples - last_samplecnt) > 0) {
-	    if (verbose)
+	    if (verbose>0)
 		printf("ao_sun: sample counter increment: %d\n", increment);
 	    if (increment < min_increment) {
 		min_increment = increment;
@@ -193,7 +193,7 @@
     if (min_increment < 2000)
 	rtsc_ok = RTSC_ENABLED;
 
-    if (verbose)
+    if (verbose>0)
 	printf("ao_sun: minimum sample counter increment per 10msec interval: %d\n"
 	       "\t%susing sample counter based timing code\n",
 	       min_increment, rtsc_ok == RTSC_ENABLED ? "" : "not ");




More information about the MPlayer-cvslog mailing list