mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 20:27:23 +00:00
ao_functions_t should be const, part 1
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25945 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
ea8ae01ee0
commit
6921ab9e24
@ -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** ao_list,int use_plugin,int rate,int c
|
||||
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** ao_list,int use_plugin,int rate,int c
|
||||
}
|
||||
// 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!
|
||||
|
@ -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
|
||||
|
2
mixer.h
2
mixer.h
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -1707,7 +1707,7 @@ static double written_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_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();
|
||||
|
Loading…
Reference in New Issue
Block a user