summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-10-07 22:44:57 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-10-07 22:44:57 +0000
commit1e6e682084644ab24c80283490a359206be52b30 (patch)
tree2b3587280867f39e90f70838c94294605b540bea /src
parentd136f913d0b86928ba4a47e49901912a312048b0 (diff)
downloadxine-lib-1e6e682084644ab24c80283490a359206be52b30.tar.gz
xine-lib-1e6e682084644ab24c80283490a359206be52b30.tar.bz2
oss softsync patche provided by bill fink
CVS patchset: 763 CVS date: 2001/10/07 22:44:57
Diffstat (limited to 'src')
-rw-r--r--src/audio_out/audio_oss_out.c9
-rw-r--r--src/xine-engine/audio_out.c90
2 files changed, 52 insertions, 47 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index cdf1dcf44..c3890c5a2 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.c
@@ -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_oss_out.c,v 1.41 2001/10/01 23:04:57 f1rmb Exp $
+ * $Id: audio_oss_out.c,v 1.42 2001/10/07 22:44:57 guenter Exp $
*
* 20-8-2001 First implementation of Audio sync and Audio driver separation.
* Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk
@@ -88,6 +88,7 @@
#define GAP_TOLERANCE 5000
#define GAP_NONRT_TOLERANCE 15000
#define MAX_GAP 90000
+#define NOT_REAL_TIME -1
#ifdef CONFIG_DEVFS_FS
#define DSP_TEMPLATE "/dev/sound/dsp%d"
@@ -116,7 +117,7 @@ typedef struct oss_driver_s {
int audio_started;
int audio_has_realtime; /* OSS driver supports real-time */
- int static_delay; /* estimated delay for non-realtime drivers */
+
struct {
char *name;
@@ -341,7 +342,7 @@ static int ao_oss_delay(ao_driver_t *this_gen)
}
} else {
- bytes_left = this->static_delay;
+ return NOT_REAL_TIME;
}
@@ -735,8 +736,6 @@ ao_driver_t *init_audio_out_plugin (config_values_t *config) {
this->output_sample_rate = 0;
this->audio_fd = -1;
- this->static_delay = config->lookup_int (config, "oss_static_delay", 1000);
-
this->config = config;
this->ao_driver.get_capabilities = ao_oss_get_capabilities;
this->ao_driver.get_property = ao_oss_get_property;
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 6f1b8fa19..a7f5d80f8 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.19 2001/10/03 15:21:29 jkeil Exp $
+ * $Id: audio_out.c,v 1.20 2001/10/07 22:44:57 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>
@@ -257,58 +257,64 @@ static int ao_write(ao_instance_t *this,
bDropPackage = 0;
- /*
- * where, in the timeline is the "end" of the audio buffer at the moment?
- */
-
- cur_time = this->metronom->get_current_time (this->metronom);
- buffer_vpts = cur_time;
-
if (this->audio_started)
delay = this->driver->delay(this->driver);
else
delay = 0;
- /* External A52 decoder delay correction */
- if ((this->mode==AO_CAP_MODE_A52) || (this->mode==AO_CAP_MODE_AC5))
- delay+=10;
+ if ((delay >=0) /* audio driver supports realtime */
+ || !this->audio_started) {
- buffer_vpts += delay * 1024 / this->frames_per_kpts;
+ /*
+ * where, in the timeline is the "end" of the audio buffer at the moment?
+ */
- /*
- * calculate gap:
- */
-
- gap = vpts - buffer_vpts;
-
- /*
- printf ("vpts : %d buffer_vpts : %d gap %d\n",
- vpts, buffer_vpts, gap);
- */
-
- if (gap>this->gap_tolerance) {
-
-
- if (gap>15000)
- ao_fill_gap (this, gap);
- else {
- printf ("audio_out: adjusting master clock %d -> %d\n",
- cur_time, cur_time + gap);
- this->metronom->adjust_clock (this->metronom,
- cur_time + gap);
- }
+ cur_time = this->metronom->get_current_time (this->metronom);
+ buffer_vpts = cur_time;
- /* keep xine responsive */
+ /* External A52 decoder delay correction */
+ if ((this->mode==AO_CAP_MODE_A52) || (this->mode==AO_CAP_MODE_AC5))
+ delay+=10;
+
+ buffer_vpts += delay * 1024 / this->frames_per_kpts;
+
+ /*
+ * calculate gap:
+ */
+
+ gap = vpts - buffer_vpts;
+
+ /*
+ printf ("vpts : %d buffer_vpts : %d gap %d\n",
+ vpts, buffer_vpts, gap);
+ */
+
+ if (gap>this->gap_tolerance) {
- if (gap>MAX_GAP)
- return 0;
- } else if (gap < (-1 * this->gap_tolerance)) {
- bDropPackage = 1;
- xprintf (VERBOSE|AUDIO, "audio_out: audio package (vpts = %d %d)"
- "dropped\n", vpts, gap);
- }
+ if (gap>15000)
+ ao_fill_gap (this, gap);
+ else {
+ printf ("audio_out: adjusting master clock %d -> %d\n",
+ cur_time, cur_time + gap);
+ this->metronom->adjust_clock (this->metronom,
+ cur_time + gap);
+ }
+
+ /* keep xine responsive */
+
+ if (gap>MAX_GAP)
+ return 0;
+
+ } else if (gap < (-1 * this->gap_tolerance)) {
+ bDropPackage = 1;
+ xprintf (VERBOSE|AUDIO, "audio_out: audio package (vpts = %d %d)"
+ "dropped\n", vpts, gap);
+ }
+ } /* audio driver supports realtime */
+
+
/*
* resample and output frames
*/