From a648ff82354a93235dbf1a2d9d0264a8c3538692 Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Fri, 13 Dec 2002 21:13:17 +0000 Subject: always set input_pos and input_time on both, audio and video buffers CVS patchset: 3513 CVS date: 2002/12/13 21:13:17 --- src/demuxers/demux_asf.c | 32 +++++++++++--------------------- src/demuxers/demux_avi.c | 6 +++--- src/demuxers/demux_real.c | 3 ++- 3 files changed, 16 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index a1e5d58d5..be528cfac 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.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_asf.c,v 1.88 2002/12/12 23:30:18 tmattern Exp $ + * $Id: demux_asf.c,v 1.89 2002/12/13 21:13:17 guenter Exp $ * * demultiplexer for asf streams * @@ -758,16 +758,11 @@ static void asf_send_buffer_nodefrag (demux_asf_t *this, asf_stream_t *stream, buf = stream->fifo->buffer_pool_alloc (stream->fifo); this->input->read (this->input, buf->content, bufsize); - if (stream->fifo == this->video_fifo) { - buf->input_pos = this->input->get_current_pos (this->input); - if (this->rate) - buf->input_time = buf->input_pos / this->rate; - else - buf->input_time = 0; - } else { - buf->input_pos = 0 ; - buf->input_time = 0 ; - } + buf->input_pos = this->input->get_current_pos (this->input); + if (this->rate) + buf->input_time = buf->input_pos / this->rate; + else + buf->input_time = 0; #ifdef LOG printf ("demux_asf: input pos is %lld, input time is %d\n", @@ -862,16 +857,11 @@ static void asf_send_buffer_defrag (demux_asf_t *this, asf_stream_t *stream, buf = stream->fifo->buffer_pool_alloc (stream->fifo); xine_fast_memcpy (buf->content, p, bufsize); - if (stream->fifo == this->video_fifo) { - buf->input_pos = this->input->get_current_pos (this->input); - if (this->rate) - buf->input_time = buf->input_pos / this->rate; - else - buf->input_time = 0; - } else { - buf->input_pos = 0 ; - buf->input_time = 0 ; - } + buf->input_pos = this->input->get_current_pos (this->input); + if (this->rate) + buf->input_time = buf->input_pos / this->rate; + else + buf->input_time = 0; buf->pts = stream->timestamp * 90 + stream->ts_per_kbyte * (p-stream->buffer) / 1024; diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 5ef57f0dd..8c9cb1a76 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.138 2002/12/12 01:40:07 miguelfreitas Exp $ + * $Id: demux_avi.c,v 1.139 2002/12/13 21:13:18 guenter Exp $ * * demultiplexer for avi streams * @@ -1089,8 +1089,8 @@ static int demux_avi_next (demux_avi_t *this, int decoder_flags) { return 0; } - buf->input_pos = 0; - buf->input_time = 0; + buf->input_time = audio_pts / 90000; + buf->input_pos = this->input->get_current_pos(this->input); buf->type = audio->audio_type | i; diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index b5e7d2d5e..609326f95 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -21,7 +21,7 @@ * For more information regarding the Real file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_real.c,v 1.23 2002/12/12 22:08:11 holstsn Exp $ + * $Id: demux_real.c,v 1.24 2002/12/13 21:13:19 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -804,6 +804,7 @@ static int demux_real_send_chunk(demux_plugin_t *this_gen) { buf->content = buf->mem; buf->pts = timestamp; buf->input_pos = this->input->get_current_pos (this->input); + buf->input_time = buf->input_pos * 8 / this->avg_bitrate ; buf->type = this->video_buf_type; -- cgit v1.2.3