diff options
author | Claudio Ciccani <klan@users.sourceforge.net> | 2006-12-18 21:31:47 +0000 |
---|---|---|
committer | Claudio Ciccani <klan@users.sourceforge.net> | 2006-12-18 21:31:47 +0000 |
commit | 25665d389818fca81eefaf83b217c0061b482551 (patch) | |
tree | 6e1fa36708ddb24af215de304c4aac628b0db518 /src/demuxers | |
parent | 8eae85edce64a5454036be7ffa5c526dc7e1f92e (diff) | |
download | xine-lib-25665d389818fca81eefaf83b217c0061b482551.tar.gz xine-lib-25665d389818fca81eefaf83b217c0061b482551.tar.bz2 |
Partially implemented RTSP seekability:
support starting the playback at an optional time by delaying the PLAY
request upon the first call to rtsp_session_read() and setting the playback
start time via input_plugin->seek_time().
CVS patchset: 8422
CVS date: 2006/12/18 21:31:47
Diffstat (limited to 'src/demuxers')
-rw-r--r-- | src/demuxers/demux_real.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 7441c8619..90852c25c 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -31,7 +31,7 @@ * * Based on FFmpeg's libav/rm.c. * - * $Id: demux_real.c,v 1.109 2006/07/10 22:08:13 dgp85 Exp $ + * $Id: demux_real.c,v 1.110 2006/12/18 21:31:47 klan Exp $ */ #ifdef HAVE_CONFIG_H @@ -1409,12 +1409,15 @@ static int demux_real_seek (demux_plugin_t *this_gen, real_index_entry_t *index, *other_index = NULL; int i = 0, entries; - start_pos = (off_t) ( (double) start_pos / 65535 * - this->input->get_length (this->input) ); + lprintf("seek start_pos=%d, start_time=%d, playing=%d\n", + (int)start_pos, start_time, playing); if((this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) && ((this->audio_stream && this->audio_stream->index) || (this->video_stream && this->video_stream->index))) { + + start_pos = (off_t) ( (double) start_pos / 65535 * + this->input->get_length (this->input) ); /* video index has priority over audio index */ if(this->video_stream && this->video_stream->index) { @@ -1453,6 +1456,13 @@ static int demux_real_seek (demux_plugin_t *this_gen, _x_demux_flush_engine(this->stream); } } + else if (this->input->seek_time != NULL) { + /* RTSP supports only time based seek */ + if (start_pos && !start_time) + start_time = (int64_t) this->duration * start_pos / 65535; + + this->input->seek_time(this->input, start_time, SEEK_SET); + } this->send_newpts = 1; this->old_seqnum = -1; |