summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorClaudio Ciccani <klan@users.sourceforge.net>2007-01-03 15:12:37 +0000
committerClaudio Ciccani <klan@users.sourceforge.net>2007-01-03 15:12:37 +0000
commiteb1296dd868a7e50b6d146cce14b0fb2cedb3021 (patch)
tree5b78f1b332713eace7e6b6b988921a84b68c4879 /src
parent35374893f50c163e0cae77dc4801c0d1b7af4d08 (diff)
downloadxine-lib-eb1296dd868a7e50b6d146cce14b0fb2cedb3021.tar.gz
xine-lib-eb1296dd868a7e50b6d146cce14b0fb2cedb3021.tar.bz2
Support setting the playback start time over MMS.
CVS patchset: 8485 CVS date: 2007/01/03 15:12:37
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_asf.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index c4c873515..1ea394356 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.189 2006/12/19 11:15:14 klan Exp $
+ * $Id: demux_asf.c,v 1.190 2007/01/03 15:12:37 klan Exp $
*
* demultiplexer for asf streams
*
@@ -1791,10 +1791,6 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
int i, state;
int64_t ts;
- start_time /= 1000;
- start_pos = (off_t) ( (double) start_pos / 65535 *
- this->input->get_length (this->input) );
-
lprintf ("demux_asf_seek: start_pos=%lld, start_time=%d\n",
start_pos, start_time);
@@ -1826,6 +1822,10 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
_x_demux_flush_engine(this->stream);
+ start_time /= 1000;
+ start_pos = (off_t) ( (double) start_pos / 65535 *
+ this->input->get_length (this->input) );
+
if ( (!start_pos) && (start_time))
start_pos = start_time * this->rate;
@@ -1953,6 +1953,22 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
this->streams[this->audio_stream].resync = 1;
this->streams[this->audio_stream].skip = 1;
}
+ } else if (!playing && this->input->seek_time != NULL) {
+ if (start_pos && !start_time)
+ start_time = this->length * start_pos / 65535;
+
+ this->input->seek_time (this->input, start_time, SEEK_SET);
+
+ this->keyframe_ts = 0;
+ this->keyframe_found = 0; /* means next keyframe */
+ if (this->video_stream >= 0) {
+ this->streams[this->video_stream].resync = 1;
+ this->streams[this->video_stream].skip = 1;
+ }
+ if (this->audio_stream >= 0) {
+ this->streams[this->audio_stream].resync = 0;
+ this->streams[this->audio_stream].skip = 0;
+ }
} else {
/* "streaming" mode */
this->keyframe_ts = 0;