[MPlayer-cvslog] r25945 - in trunk: libao2/audio_out.c libao2/audio_out.h mixer.h mp_core.h mplayer.c

reimar subversion at mplayerhq.hu
Fri Feb 1 21:11:14 CET 2008


Author: reimar
Date: Fri Feb  1 21:11:14 2008
New Revision: 25945

Log:
ao_functions_t should be const, part 1


Modified:
   trunk/libao2/audio_out.c
   trunk/libao2/audio_out.h
   trunk/mixer.h
   trunk/mp_core.h
   trunk/mplayer.c

Modified: trunk/libao2/audio_out.c
==============================================================================
--- trunk/libao2/audio_out.c	(original)
+++ trunk/libao2/audio_out.c	Fri Feb  1 21:11:14 2008
@@ -75,7 +75,7 @@ extern ao_functions_t audio_out_mpegpes;
 extern ao_functions_t audio_out_pcm;
 extern ao_functions_t audio_out_pss;
 
-ao_functions_t* audio_out_drivers[] =
+const ao_functions_t* const audio_out_drivers[] =
 {
 // native:
 #ifdef HAVE_DIRECTX
@@ -154,7 +154,7 @@ void list_audio_out(void){
       mp_msg(MSGT_GLOBAL, MSGL_INFO,"\n");
 }
 
-ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate,int channels,int format,int flags){
+const ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate,int channels,int format,int flags){
     int i;
     // first try the preferred drivers, with their optional subdevice param:
     if(ao_list && ao_list[0])
@@ -177,7 +177,7 @@ ao_functions_t* init_best_audio_out(char
 	else
 	    ao_len = strlen(ao);
 	for(i=0;audio_out_drivers[i];i++){
-	    ao_functions_t* audio_out=audio_out_drivers[i];
+	    const ao_functions_t* audio_out=audio_out_drivers[i];
 	    if(!strncmp(audio_out->info->short_name,ao,ao_len)){
 		// name matches, try it
 		if(audio_out->init(rate,channels,format,flags))
@@ -194,7 +194,7 @@ ao_functions_t* init_best_audio_out(char
     }
     // now try the rest...
     for(i=0;audio_out_drivers[i];i++){
-	ao_functions_t* audio_out=audio_out_drivers[i];
+	const ao_functions_t* audio_out=audio_out_drivers[i];
 //	if(audio_out->control(AOCONTROL_QUERY_FORMAT, (int)format) == CONTROL_TRUE)
 	if(audio_out->init(rate,channels,format,flags))
 	    return audio_out; // success!

Modified: trunk/libao2/audio_out.h
==============================================================================
--- trunk/libao2/audio_out.h	(original)
+++ trunk/libao2/audio_out.h	Fri Feb  1 21:11:14 2008
@@ -45,10 +45,10 @@ extern char *ao_subdevice;
 extern ao_data_t ao_data;
 
 void list_audio_out(void);
-ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate,int channels,int format,int flags);
+const ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate,int channels,int format,int flags);
 
 // NULL terminated array of all drivers
-extern ao_functions_t* audio_out_drivers[];
+extern const ao_functions_t* const audio_out_drivers[];
 
 #define CONTROL_OK 1
 #define CONTROL_TRUE 1

Modified: trunk/mixer.h
==============================================================================
--- trunk/mixer.h	(original)
+++ trunk/mixer.h	Fri Feb  1 21:11:14 2008
@@ -10,7 +10,7 @@ extern int soft_vol;
 extern float soft_vol_max;
 
 typedef struct mixer_s {
-    ao_functions_t *audio_out;
+    const ao_functions_t *audio_out;
     af_stream_t *afilter;
     int volstep;
     int muted;

Modified: trunk/mp_core.h
==============================================================================
--- trunk/mp_core.h	(original)
+++ trunk/mp_core.h	Fri Feb  1 21:11:14 2008
@@ -36,7 +36,7 @@
 typedef struct MPContext {
     int osd_show_percentage;
     int osd_function;
-    ao_functions_t *audio_out;
+    const ao_functions_t *audio_out;
     play_tree_t *playtree;
     play_tree_iter_t *playtree_iter;
     int eof;
@@ -115,7 +115,7 @@ void uninit_player(unsigned int mask);
 void reinit_audio_chain(void);
 void init_vo_spudec(void);
 double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio,
-			 ao_functions_t *audio_out);
+			 const ao_functions_t *audio_out);
 void exit_player_with_rc(const char* how, int rc);
 void add_subtitles(char *filename, float fps, int noerr);
 int reinit_video_chain(void);

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	(original)
+++ trunk/mplayer.c	Fri Feb  1 21:11:14 2008
@@ -1707,7 +1707,7 @@ static double written_audio_pts(sh_audio
 
 // Return pts value corresponding to currently playing audio.
 double playing_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio,
-				ao_functions_t *audio_out)
+				const ao_functions_t *audio_out)
 {
     return written_audio_pts(sh_audio, d_audio) - playback_speed *
 	audio_out->get_delay();



More information about the MPlayer-cvslog mailing list