Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-mplayer: Commit

external/mplayer


Commit MetaInfo

Revisión0769e0ad48dad2ac49dea105d6ba9f7e101cb271 (tree)
Tiempo2010-10-11 14:06:03
AutorOwen Kwon <pinebud77@hotm...>
CommiterOwen Kwon

Log Message

modified ao setting, removed some debug prints

Cambiar Resumen

Diferencia

--- a/MPlayer.cpp
+++ b/MPlayer.cpp
@@ -125,6 +125,7 @@ namespace android {
125125 "-vo", "mem", "-framedrop",
126126 "-ao", "pcm_mem", "-noconsolecontrols", "-nojoystick",
127127 "-nolirc", "-nomouseinput", "-slave", "-zoom", "-fs",
128+ "-quiet",
128129 0};
129130 char url_buffer[100];
130131 char screenh_buffer[30];
--- a/libao2/ao_pcm_mem.c
+++ b/libao2/ao_pcm_mem.c
@@ -39,8 +39,6 @@
3939 #include <windows.h>
4040 #endif
4141
42-#define BUFFER_ROUND_SIZE 64 /* -_-? */
43-
4442 static const ao_info_t info =
4543 {
4644 "RAW PCM/WAVE memory writer audio output",
@@ -139,9 +137,9 @@ static int init(int rate,int channels,int format,int flags){
139137 format = AF_FORMAT_S16_LE;
140138 int samplesize = af_fmt2bits(format) / 8;
141139
142- ao_data.outburst = 1024 * channels * samplesize;
140+ ao_data.outburst = 256 * channels * samplesize;
143141 // A "buffer" for about 0.3 seconds of audio
144- ao_data.buffersize = (int)(rate * 0.1 / 256 + 1) * ao_data.outburst;
142+ ao_data.buffersize = (int)(rate * 0.2 / 256 + 1) * ao_data.outburst;
145143 ao_data.channels=channels;
146144 ao_data.samplerate=rate;
147145 ao_data.format=format;
@@ -186,12 +184,9 @@ static int get_space(void){
186184 int real_space;
187185 int rounded_buffer;
188186 drain();
189- rounded_buffer = (buffer - BUFFER_ROUND_SIZE/2) / BUFFER_ROUND_SIZE
190- * BUFFER_ROUND_SIZE;
187+ rounded_buffer = buffer / ao_data.bps * ao_data.bps;
191188 virt_space = ao_data.buffersize - rounded_buffer;
192189 real_space = ao_pcm_buffersize - ao_outputpos;
193- mp_msg (MSGT_AO, MSGL_INFO, "vir space %d, real space %d",
194- virt_space, real_space);
195190 if (virt_space > real_space) return real_space;
196191 else return virt_space;
197192 }
@@ -227,6 +222,9 @@ static int play(void* data,int len,int flags){
227222
228223 // return: delay in seconds between first and last sample in buffer
229224 static float get_delay(void){
225+ int rounded_buffer;
230226 drain();
231- return (float) buffer / (float) ao_data.bps;
227+ rounded_buffer = buffer / ao_data.bps * ao_data.bps;
228+
229+ return (float) rounded_buffer / (float) ao_data.bps;
232230 }
--- a/mplayer_lib.c
+++ b/mplayer_lib.c
@@ -2234,7 +2234,7 @@ static int sleep_until_update(float *time_frame, float *aq_sleep_time)
22342234
22352235 // flag 256 means: libvo driver does its timing (dvb card)
22362236 if (*time_frame > 0.001 && !(vo_flags&256)) {
2237- mp_msg(MSGT_CPLAYER,MSGL_INFO,"timing_sleep %f", *time_frame);
2237+// mp_msg(MSGT_CPLAYER,MSGL_INFO,"timing_sleep %f", *time_frame);
22382238 *time_frame = timing_sleep(*time_frame);
22392239 }
22402240 return frame_time_remaining;
@@ -3790,7 +3790,6 @@ int mplayer_after_decode (struct mplayer_context * con)
37903790 int frame_time_remaining = con->frame_time_remaining;
37913791
37923792 vout_time_usage += (GetTimer() - con->t2) * 0.000001;
3793- mp_msg(MSGT_CPLAYER,MSGL_INFO,"vout time %u\n", vout_time_usage);
37943793
37953794
37963795 if (mpctx->sh_video) {
Show on old repository browser