diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-03-27 18:56:54 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2003-03-27 18:56:54 +0000 |
commit | 69b02732999c6708986554ba5cdf66e0fb65e5b1 (patch) | |
tree | 3ce036bc9ea13da6f35f7068c6950aaaa35643af /src | |
parent | d27b3249eab1ff62a64029f6d94e5a3ccb87b151 (diff) | |
download | xine-lib-69b02732999c6708986554ba5cdf66e0fb65e5b1.tar.gz xine-lib-69b02732999c6708986554ba5cdf66e0fb65e5b1.tar.bz2 |
- demux_avi: do not set input_pos/time on audio buffers. otherwise non-interlaved or
bad interleaved files show slider problems
- make metronom prebuffer configurable. see metronom.h for comments.
CVS patchset: 4501
CVS date: 2003/03/27 18:56:54
Diffstat (limited to 'src')
-rw-r--r-- | src/demuxers/demux_avi.c | 5 | ||||
-rw-r--r-- | src/xine-engine/metronom.c | 13 | ||||
-rw-r--r-- | src/xine-engine/metronom.h | 10 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 5 | ||||
-rw-r--r-- | src/xine-engine/xine_interface.c | 13 | ||||
-rw-r--r-- | src/xine-engine/xine_internal.h | 4 |
6 files changed, 31 insertions, 19 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 3d9503856..8465ced4c 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.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: demux_avi.c,v 1.153 2003/03/07 12:51:47 guenter Exp $ + * $Id: demux_avi.c,v 1.154 2003/03/27 18:56:58 miguelfreitas Exp $ * * demultiplexer for avi streams * @@ -1115,9 +1115,6 @@ static int demux_avi_next (demux_avi_t *this, int decoder_flags) { return 0; } - buf->extra_info->input_time = audio_pts / 90; - buf->extra_info->input_pos = this->input->get_current_pos(this->input); - buf->type = audio->audio_type | i; if(this->audio_fifo) { diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 775fcd0f1..1b6b808c7 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.113 2003/03/06 16:49:33 guenter Exp $ + * $Id: metronom.c,v 1.114 2003/03/27 18:57:05 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -43,7 +43,6 @@ #define WRAP_THRESHOLD 120000 #define MAX_NUM_WRAP_DIFF 10 #define MAX_SCR_PROVIDERS 10 -#define PREBUFFER_PTS_OFFSET 30000 #define VIDEO_DRIFT_TOLERANCE 45000 #define AUDIO_DRIFT_TOLERANCE 45000 @@ -307,14 +306,16 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type, if ( this->video_vpts < this->clock->get_current_time(this->clock) || type == DISC_STREAMSTART || type == DISC_STREAMSEEK ) { - this->video_vpts = PREBUFFER_PTS_OFFSET + this->clock->get_current_time(this->clock); + this->video_vpts = this->stream->metronom_prebuffer + + this->clock->get_current_time(this->clock); if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) printf ("metronom: video vpts adjusted with prebuffer to %lld\n", this->video_vpts); } if ( this->audio_vpts < this->clock->get_current_time(this->clock) || type == DISC_STREAMSTART || type == DISC_STREAMSEEK ) { - this->audio_vpts = PREBUFFER_PTS_OFFSET + this->clock->get_current_time(this->clock); + this->audio_vpts = this->stream->metronom_prebuffer + + this->clock->get_current_time(this->clock); if (this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) printf ("metronom: audio vpts adjusted with prebuffer to %lld\n", this->audio_vpts); @@ -784,7 +785,7 @@ metronom_t * metronom_init (int have_audio, xine_stream_t *stream) { /* initialize video stuff */ - this->video_vpts = PREBUFFER_PTS_OFFSET; + this->video_vpts = stream->metronom_prebuffer; this->video_drift = 0; this->video_drift_step = 0; this->video_discontinuity_count = 0; @@ -798,7 +799,7 @@ metronom_t * metronom_init (int have_audio, xine_stream_t *stream) { /* initialize audio stuff */ this->have_audio = have_audio; - this->audio_vpts = PREBUFFER_PTS_OFFSET; + this->audio_vpts = this->stream->metronom_prebuffer; this->audio_discontinuity_count = 0; pthread_cond_init (&this->audio_discontinuity_reached, NULL); diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h index 76f24039f..79129fbc9 100644 --- a/src/xine-engine/metronom.h +++ b/src/xine-engine/metronom.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: metronom.h,v 1.43 2003/01/13 02:15:07 miguelfreitas Exp $ + * $Id: metronom.h,v 1.44 2003/03/27 18:57:08 miguelfreitas Exp $ * * metronom: general pts => virtual calculation/assoc * @@ -57,6 +57,14 @@ typedef struct metronom_s metronom_t ; typedef struct metronom_clock_s metronom_clock_t; typedef struct scr_plugin_s scr_plugin_t; +/* metronom prebuffer can be adjusted with XINE_PARAM_METRONOM_PREBUFFER. + * it sets how much the first video/audio frame should be delayed to + * have some prebuffering at the output layers. reducing this value (about + * 1/3 sec) may result in faster seeking (good to simulate play backwards, + * for example). + */ +#define PREBUFFER_PTS_OFFSET 30000 + /* see below */ #define DISC_STREAMSTART 0 #define DISC_RELATIVE 1 diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 6bbca42d3..144789039 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.238 2003/03/25 12:52:37 mroi Exp $ + * $Id: xine.c,v 1.239 2003/03/27 18:57:10 miguelfreitas Exp $ * * top-level xine functions * @@ -400,7 +400,8 @@ xine_stream_t *xine_stream_new (xine_t *this, stream->err = 0; stream->next_audio_port = NULL; stream->next_video_port = NULL; - + stream->metronom_prebuffer = PREBUFFER_PTS_OFFSET; + /* * initial master/slave */ diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c index 72167bd12..55204e591 100644 --- a/src/xine-engine/xine_interface.c +++ b/src/xine-engine/xine_interface.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: xine_interface.c,v 1.46 2003/03/26 11:06:59 miguelfreitas Exp $ + * $Id: xine_interface.c,v 1.47 2003/03/27 18:57:12 miguelfreitas Exp $ * * convenience/abstraction layer, functions to implement * libxine's public interface @@ -402,6 +402,10 @@ void xine_set_param (xine_stream_t *stream, int param, int value) { stream->stream_info[XINE_STREAM_INFO_IGNORE_SPU] = value; break; + case XINE_PARAM_METRONOM_PREBUFFER: + stream->metronom_prebuffer = value; + break; + default: printf ("xine_interface: unknown param %d\n", param); } @@ -462,19 +466,18 @@ int xine_get_param (xine_stream_t *stream, int param) { case XINE_PARAM_VO_PAN_SCAN: case XINE_PARAM_VO_TVMODE: return stream->video_out->get_property(stream->video_out, param); - break; case XINE_PARAM_IGNORE_VIDEO: return stream->stream_info[XINE_STREAM_INFO_IGNORE_VIDEO]; - break; case XINE_PARAM_IGNORE_AUDIO: return stream->stream_info[XINE_STREAM_INFO_IGNORE_AUDIO]; - break; case XINE_PARAM_IGNORE_SPU: return stream->stream_info[XINE_STREAM_INFO_IGNORE_SPU]; - break; + + case XINE_PARAM_METRONOM_PREBUFFER: + return stream->metronom_prebuffer; default: printf ("xine_interface: unknown param %d\n", param); diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h index 1724af485..c8921a181 100644 --- a/src/xine-engine/xine_internal.h +++ b/src/xine-engine/xine_internal.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: xine_internal.h,v 1.130 2003/03/25 12:52:41 mroi Exp $ + * $Id: xine_internal.h,v 1.131 2003/03/27 18:57:15 miguelfreitas Exp $ * */ @@ -257,6 +257,8 @@ struct xine_stream_s { pthread_mutex_t next_audio_port_lock; pthread_cond_t next_video_port_wired; pthread_cond_t next_audio_port_wired; + + int64_t metronom_prebuffer; }; |