summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_mpeg_block.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2005-10-14 21:02:16 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2005-10-14 21:02:16 +0000
commit8e323392d562170c64b5f1acd8b786c4a4a1e161 (patch)
tree143fbcd4604af5fc66b5bc13cf6ed9d8dff73341 /src/demuxers/demux_mpeg_block.c
parent6e8c0b93f15a594e8218db242b060f1b616539e1 (diff)
downloadxine-lib-8e323392d562170c64b5f1acd8b786c4a4a1e161.tar.gz
xine-lib-8e323392d562170c64b5f1acd8b786c4a4a1e161.tar.bz2
input plugin time seeking patch.
hopefuly somebody will be able to help fixing the mess i did in dvdnav ;) CVS patchset: 7759 CVS date: 2005/10/14 21:02:16
Diffstat (limited to 'src/demuxers/demux_mpeg_block.c')
-rw-r--r--src/demuxers/demux_mpeg_block.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index 4a2f7b6e8..e59910cad 100644
--- a/src/demuxers/demux_mpeg_block.c
+++ b/src/demuxers/demux_mpeg_block.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_mpeg_block.c,v 1.211 2005/02/06 15:26:16 tmattern Exp $
+ * $Id: demux_mpeg_block.c,v 1.212 2005/10/14 21:02:16 miguelfreitas Exp $
*
* demultiplexer for mpeg 1/2 program streams
* used with fixed blocksize devices (like dvd/vcd)
@@ -1268,7 +1268,6 @@ static int demux_mpeg_block_seek (demux_plugin_t *this_gen,
demux_mpeg_block_t *this = (demux_mpeg_block_t *) this_gen;
start_pos = (off_t) ( (double) start_pos / 65535 *
this->input->get_length (this->input) );
- start_time /= 1000;
if((this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) != 0) {
@@ -1279,20 +1278,26 @@ static int demux_mpeg_block_seek (demux_plugin_t *this_gen,
this->input->seek (this->input, start_pos, SEEK_SET);
} else if (start_time) {
- if (this->last_cell_time) {
- start_pos = start_time - (this->last_cell_time + this->last_begin_time)/1000;
- start_pos *= this->rate;
- start_pos *= 50;
- start_pos += this->last_cell_pos;
+ if( this->input->seek_time ) {
+ this->input->seek_time (this->input, start_time, SEEK_SET);
} else {
- start_pos = start_time;
- start_pos *= this->rate;
- start_pos *= 50;
+ start_time /= 1000;
+
+ if (this->last_cell_time) {
+ start_pos = start_time - (this->last_cell_time + this->last_begin_time)/1000;
+ start_pos *= this->rate;
+ start_pos *= 50;
+ start_pos += this->last_cell_pos;
+ } else {
+ start_pos = start_time;
+ start_pos *= this->rate;
+ start_pos *= 50;
+ }
+ start_pos /= (off_t) this->blocksize;
+ start_pos *= (off_t) this->blocksize;
+
+ this->input->seek (this->input, start_pos, SEEK_SET);
}
- start_pos /= (off_t) this->blocksize;
- start_pos *= (off_t) this->blocksize;
-
- this->input->seek (this->input, start_pos, SEEK_SET);
} else
this->input->seek (this->input, 0, SEEK_SET);
}