summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_out/video_out_xshm.c4
-rw-r--r--src/xine-engine/audio_decoder.c11
-rw-r--r--src/xine-engine/audio_out.c59
-rw-r--r--src/xine-engine/metronom.c7
4 files changed, 46 insertions, 35 deletions
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index 7a3469ff8..0a015d3ee 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.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: video_out_xshm.c,v 1.59 2002/02/17 15:53:28 guenter Exp $
+ * $Id: video_out_xshm.c,v 1.60 2002/02/18 15:55:44 guenter Exp $
*
* video_out_xshm.c, X11 shared memory extension interface for xine
*
@@ -672,6 +672,8 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
frame->stripe_height = 16 * frame->output_height / frame->height;
+ /* printf ("video_out_xshm: stripe height is %d\n", frame->stripe_height); */
+
/*
* set up colorspace converter
*/
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c
index 7f73ebbc1..19510a3c7 100644
--- a/src/xine-engine/audio_decoder.c
+++ b/src/xine-engine/audio_decoder.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_decoder.c,v 1.59 2002/02/17 17:32:50 guenter Exp $
+ * $Id: audio_decoder.c,v 1.60 2002/02/18 15:55:44 guenter Exp $
*
*
* functions that implement audio decoding
@@ -36,6 +36,9 @@
#include "xine_internal.h"
#include "xineutils.h"
+/*
+#define LOG
+*/
void *audio_decoder_loop (void *this_gen) {
@@ -50,16 +53,16 @@ void *audio_decoder_loop (void *this_gen) {
while (running) {
-#ifdef AUDIO_DECODER_LOG
+#ifdef LOG
printf ("audio_loop: waiting for package...\n");
#endif
buf = this->audio_fifo->get (this->audio_fifo);
-#ifdef AUDIO_DECODER_LOG
+#ifdef LOG
printf ("audio_loop: got package pts = %d, type = %08x\n",
- buf->PTS, buf->type);
+ buf->pts, buf->type);
#endif
if (buf->input_pos)
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 1ab098f6a..8ec3094c8 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.41 2002/02/17 17:32:50 guenter Exp $
+ * $Id: audio_out.c,v 1.42 2002/02/18 15:55:44 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>
@@ -67,9 +67,8 @@
#include "resample.h"
#include "metronom.h"
-
/*
-#define AUDIO_OUT_LOG
+#define LOG
*/
#define NUM_AUDIO_BUFFERS 32
@@ -204,13 +203,14 @@ void write_pause_burst(ao_instance_t *this, uint32_t num_frames)
}
-static void ao_fill_gap (ao_instance_t *this, uint32_t pts_len) {
+static void ao_fill_gap (ao_instance_t *this, int64_t pts_len) {
int num_frames ;
num_frames = pts_len * this->frames_per_kpts / 1024;
- printf ("audio_out: inserting %d 0-frames to fill a gap of %d pts\n",num_frames, pts_len);
+ printf ("audio_out: inserting %d 0-frames to fill a gap of %lld pts\n",
+ num_frames, pts_len);
if ((this->mode == AO_CAP_MODE_A52) || (this->mode == AO_CAP_MODE_AC5)) {
write_pause_burst(this,num_frames);
@@ -233,22 +233,17 @@ static void ao_fill_gap (ao_instance_t *this, uint32_t pts_len) {
static void *ao_loop (void *this_gen) {
ao_instance_t *this = (ao_instance_t *) this_gen;
- uint32_t hw_vpts;
+ int64_t hw_vpts;
audio_buffer_t *buf;
- int32_t gap;
+ int64_t gap;
int delay;
- uint32_t cur_time;
+ int64_t cur_time;
int num_output_frames ;
int paused_wait;
while ((this->audio_loop_running) ||
(!this->audio_loop_running && this->out_fifo->first)) {
-
-#ifdef AUDIO_OUT_LOG
- printf ("audio_out: fifo_remove\n");
-#endif
-
buf = fifo_remove (this->out_fifo);
do {
@@ -262,8 +257,8 @@ static void *ao_loop (void *this_gen) {
cur_time = this->metronom->get_current_time (this->metronom);
hw_vpts = cur_time;
-#ifdef AUDIO_OUT_LOG
- printf ("audio_out: current delay is %d, current time is %d\n",
+#ifdef LOG
+ printf ("audio_out: current delay is %d, current time is %lld\n",
delay, cur_time);
#endif
@@ -290,11 +285,10 @@ static void *ao_loop (void *this_gen) {
xine_usec_sleep (50000);
} while ( paused_wait );
-
- /*
- printf ("vpts : %d buffer_vpts : %d gap %d\n",
- hw_vpts, buf->vpts, gap);
- */
+#ifdef LOG
+ printf ("audio_out: hw_vpts : %lld buffer_vpts : %lld gap : %lld\n",
+ hw_vpts, buf->vpts, gap);
+#endif
/*
* output audio data synced to master clock
@@ -305,8 +299,8 @@ static void *ao_loop (void *this_gen) {
/* drop package */
-#ifdef AUDIO_OUT_LOG
- printf ("audio_out: audio package (vpts = %d %d) dropped\n",
+#ifdef LOG
+ printf ("audio_out: audio package (vpts = %lld, gap = %lld) dropped\n",
buf->vpts, gap);
#endif
@@ -317,7 +311,7 @@ static void *ao_loop (void *this_gen) {
if (gap>15000)
ao_fill_gap (this, gap);
else {
- printf ("audio_out: adjusting master clock %d -> %d\n",
+ printf ("audio_out: adjusting master clock %lld -> %lld\n",
cur_time, cur_time + gap);
this->metronom->adjust_clock (this->metronom,
cur_time + gap);
@@ -328,9 +322,13 @@ static void *ao_loop (void *this_gen) {
/*
* resample and output audio data
*/
-
+
num_output_frames = (double) buf->num_frames * this->frame_rate_factor;
+#ifdef LOG
+ printf ("audio_out: outputting %d frames\n", num_output_frames);
+#endif
+
if ((!this->do_resample)
&& (this->mode != AO_CAP_MODE_A52)
&& (this->mode != AO_CAP_MODE_AC5)) {
@@ -430,7 +428,7 @@ static int ao_open(ao_instance_t *this,
this->frame_rate_factor = (double) this->output_frame_rate / (double) this->input_frame_rate;
this->audio_step = (uint32_t) 90000 * (uint32_t) 32768 / this->input_frame_rate;
this->frames_per_kpts = this->output_frame_rate * 1024 / 90000;
-#ifdef AUDIO_OUT_LOG
+#ifdef LOG
printf ("audio_out : audio_step %d pts per 32768 frames\n", this->audio_step);
#endif
@@ -466,14 +464,23 @@ static audio_buffer_t *ao_get_buffer (ao_instance_t *this) {
static void ao_put_buffer (ao_instance_t *this, audio_buffer_t *buf) {
+ int64_t pts;
+
if (buf->num_frames == 0) {
fifo_append (this->free_fifo, buf);
return;
}
- buf->vpts = this->metronom->got_audio_samples (this->metronom, buf->vpts,
+ pts = buf->vpts;
+
+ buf->vpts = this->metronom->got_audio_samples (this->metronom, pts,
buf->num_frames, buf->scr);
+#ifdef LOG
+ printf ("audio_out: got buffer, pts=%lld, vpts=%lld\n",
+ pts, buf->vpts);
+#endif
+
if ( buf->vpts<this->last_audio_vpts) {
/* reject buffer */
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 27db93c7d..7bea58347 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.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: metronom.c,v 1.57 2002/02/18 13:33:19 guenter Exp $
+ * $Id: metronom.c,v 1.58 2002/02/18 15:55:44 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -47,8 +47,6 @@
#define PREBUFFER_PTS_OFFSET 30000
#define VIDEO_DRIFT_TOLERANCE 45000
-#define METRONOM_REPORT
-
/*
#define LOG
*/
@@ -433,7 +431,8 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) {
this->video_vpts -= diff / 8; /* FIXME: better heuristics ? */
/* make wrap_offset consistent with the drift correction */
- this->video_wrap_offset = this->video_vpts - pts;
+ /* this->video_wrap_offset = this->video_vpts - pts; */
+ /* don't touch wrap here, wrap offsets are used for wrap compensation */
#ifdef LOG
printf ("metronom: video drift, wrap offset is now %lld\n",