summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2002-01-06 00:25:56 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2002-01-06 00:25:56 +0000
commitfe19feae2b408ba21476fe79d84e9c3260cfa48e (patch)
treea7a0355eef879db5f8ab944dd66ee9a03f8b7bfe
parent13927be9bdf9d2d67a68e3ba5a00a23a78b94227 (diff)
downloadxine-lib-fe19feae2b408ba21476fe79d84e9c3260cfa48e.tar.gz
xine-lib-fe19feae2b408ba21476fe79d84e9c3260cfa48e.tar.bz2
better support for live streamed asf files
CVS patchset: 1349 CVS date: 2002/01/06 00:25:56
-rw-r--r--src/demuxers/demux_asf.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index b6696416d..25cb96b9c 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.18 2002/01/02 18:16:07 jkeil Exp $
+ * $Id: demux_asf.c,v 1.19 2002/01/06 00:25:56 guenter Exp $
*
* demultiplexer for asf streams
*
@@ -456,9 +456,10 @@ static int asf_read_header (demux_asf_t *this) {
end_time = get_le64 (this);
this->length = get_le64(this) / 10000000;
- if (this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) {
+ if ( (this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE)
+ && (this->length) )
this->rate = this->input->get_length (this->input) / this->length;
- } else
+ else
this->rate = 0;
LOG_MSG(this->xine, _("demux_asf: stream length is %d sec, rate is %d bytes/sec\n"),
@@ -690,7 +691,10 @@ static void asf_send_buffer_nodefrag (demux_asf_t *this, asf_stream_t *stream,
if (stream->fifo == this->video_fifo) {
buf->input_pos = this->input->get_current_pos (this->input);
- buf->input_time = buf->input_pos / this->rate;
+ 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 ;
@@ -759,7 +763,10 @@ static void asf_send_buffer_defrag (demux_asf_t *this, asf_stream_t *stream,
if (stream->fifo == this->video_fifo) {
buf->input_pos = this->input->get_current_pos (this->input);
- buf->input_time = buf->input_pos / this->rate;
+ 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 ;