changeset 969:a2a296d46bff

new option: -srate
author arpi_esp
date Sun, 03 Jun 2001 19:46:22 +0000
parents 064a6422fd42
children d484625a884e
files cfg-mplayer.h mplayer.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-mplayer.h	Sun Jun 03 19:09:17 2001 +0000
+++ b/cfg-mplayer.h	Sun Jun 03 19:46:22 2001 +0000
@@ -103,6 +103,7 @@
 //	{"vids", &avi_header.video_codec, CONF_TYPE_STRING, 0, 0, 0},
 	{"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10},
 	{"fps", &force_fps, CONF_TYPE_FLOAT, CONF_MIN, 0, 0},
+	{"srate", &force_srate, CONF_TYPE_INT, CONF_RANGE, 1000, 96001},
 	{"afm", &audio_format, CONF_TYPE_INT, CONF_RANGE, 1, 6},
 	{"dshow", &allow_dshow, CONF_TYPE_FLAG, 0, 0, 1},
 	{"nodshow", &allow_dshow, CONF_TYPE_FLAG, 0, 1, 0},
--- a/mplayer.c	Sun Jun 03 19:09:17 2001 +0000
+++ b/mplayer.c	Sun Jun 03 19:46:22 2001 +0000
@@ -417,6 +417,7 @@
 float default_max_pts_correction=-1;//0.01f;
 int delay_corrected=1;
 float force_fps=0;
+int force_srate=0;
 float audio_delay=0;
 float initial_pts_delay=0;
 int vcd_track=0;
@@ -1407,7 +1408,8 @@
 
 if(has_audio){
 
-  if(!audio_out->init(sh_audio->samplerate,sh_audio->channels,sh_audio->sample_format,0)){
+  if(!audio_out->init(force_srate?force_srate:sh_audio->samplerate,
+      sh_audio->channels,sh_audio->sample_format,0)){
     printf("couldn't open/init audio device -> NOSOUND\n");
     has_audio=0;
   }