summaryrefslogtreecommitdiff
path: root/src/xine-engine
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-08-24 01:05:30 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-08-24 01:05:30 +0000
commit78be10fff9258917b01d713eed3a91dfac4b45e2 (patch)
tree07163dc8cdac909e342b16fa7e321d9da74826b5 /src/xine-engine
parent572a2ac889e9dd705a4b8243038fb8d44b4a7a6b (diff)
downloadxine-lib-78be10fff9258917b01d713eed3a91dfac4b45e2.tar.gz
xine-lib-78be10fff9258917b01d713eed3a91dfac4b45e2.tar.bz2
fixed esd / gap support (configureable), coding style enforcement
CVS patchset: 475 CVS date: 2001/08/24 01:05:30
Diffstat (limited to 'src/xine-engine')
-rw-r--r--src/xine-engine/audio_out.c15
-rw-r--r--src/xine-engine/audio_out.h10
2 files changed, 18 insertions, 7 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 1547ea8a7..c080866cc 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -17,7 +17,7 @@
* along with self program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_out.c,v 1.7 2001/08/23 21:40:05 guenter Exp $
+ * $Id: audio_out.c,v 1.8 2001/08/24 01:05:31 guenter Exp $
*
* 22-8-2001 James imported some useful AC3 sections from the previous alsa driver.
* (c) 2001 Andy Lo A Foe <andy@alsaplayer.org>
@@ -68,7 +68,6 @@
#define ZERO_BUF_SIZE 5000
-#define GAP_TOLERANCE 5000
#define MAX_GAP 90000
struct frmsize_s
@@ -276,8 +275,13 @@ static int ao_write(ao_instance_t *this,
*/
gap = vpts - buffer_vpts;
-
- if (gap>GAP_TOLERANCE) {
+
+ /*
+ printf ("vpts : %d buffer_vpts : %d gap %d\n",
+ vpts, buffer_vpts, gap);
+ */
+
+ if (gap>this->gap_tolerance) {
ao_fill_gap (this, gap);
/* keep xine responsive */
@@ -285,7 +289,7 @@ static int ao_write(ao_instance_t *this,
if (gap>MAX_GAP)
return 0;
- } else if (gap<-GAP_TOLERANCE) {
+ } else if (gap < (-1 * this->gap_tolerance)) {
bDropPackage = 1;
xprintf (VERBOSE|AUDIO, "audio_out: audio package (vpts = %d %d)"
"dropped\n", vpts, gap);
@@ -393,6 +397,7 @@ ao_instance_t *ao_new_instance (ao_driver_t *driver, metronom_t *metronom,
this->audio_loop_running = 0;
this->frame_buffer = xmalloc (40000);
this->zero_space = xmalloc (ZERO_BUF_SIZE * 2 * 6);
+ this->gap_tolerance = driver->get_gap_tolerance (this->driver);
this->resample_conf = config->lookup_int (config, "audio_resample_mode", 0);
diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h
index c7ea69b3e..047529492 100644
--- a/src/xine-engine/audio_out.h
+++ b/src/xine-engine/audio_out.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_out.h,v 1.10 2001/08/23 21:40:05 guenter Exp $
+ * $Id: audio_out.h,v 1.11 2001/08/24 01:05:31 guenter Exp $
*/
#ifndef HAVE_AUDIO_OUT_H
#define HAVE_AUDIO_OUT_H
@@ -76,6 +76,11 @@ struct ao_driver_s {
*/
int (*delay)(ao_driver_t *self_gen);
+ /*
+ * return gap tolerance (in pts) needed for this driver
+ */
+ int (*get_gap_tolerance) (ao_driver_t *self_gen);
+
/*
* write audio data to output buffer
* audio driver must sync sample playback with metronom
@@ -134,7 +139,7 @@ struct ao_instance_s {
* call write_audio_data with the _same_ samples again
*/
- int (*write)(ao_driver_t *this,
+ int (*write)(ao_instance_t *this,
int16_t* audio_data, uint32_t num_frames,
uint32_t pts);
@@ -162,6 +167,7 @@ struct ao_instance_s {
int resample_conf;
int do_resample;
int mode;
+ int gap_tolerance;
uint16_t *frame_buffer;
int16_t *zero_space;
};