summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-08-01 22:53:09 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:15:01 +0200
commit5c76f24b0958f78e45379514a42786450e27b2c1 (patch)
treef946ae1b2d089663f0667281def72a5d2982f35d /stream
parent0a321e01e3657ed29219623696ce0963044e38f7 (diff)
downloadmpv-5c76f24b0958f78e45379514a42786450e27b2c1.tar.bz2
mpv-5c76f24b0958f78e45379514a42786450e27b2c1.tar.xz
stream_dvd: Improve seeking by position
The current code takes the angle into account. This is a mistake since the position is independent of the angle. patch by Olivier Rolland, billl users.sourceforge net git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31895 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_dvd.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 80ce205417..03f5040536 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -343,24 +343,17 @@ static void dvd_seek(dvd_priv_t *d, int pos)
d->cur_pack<d->cur_pgc->cell_playback[ d->cur_cell ].first_sector) {
// ok, cell change, find the right cell!
- d->cur_cell=0;
- if(d->cur_pgc->cell_playback[d->cur_cell].block_type == BLOCK_TYPE_ANGLE_BLOCK )
- d->cur_cell+=dvd_angle;
-
- while(1) {
- int next;
- d->cell_last_pack=d->cur_pgc->cell_playback[ d->cur_cell ].last_sector;
- if(d->cur_pack<d->cur_pgc->cell_playback[ d->cur_cell ].first_sector) {
- d->cur_pack=d->cur_pgc->cell_playback[ d->cur_cell ].first_sector;
+ cell_playback_t *cell;
+ for(d->cur_cell=0; d->cur_cell < d->cur_pgc->nr_of_cells; d->cur_cell++) {
+ cell = &(d->cur_pgc->cell_playback[d->cur_cell]);
+ if(cell->block_type == BLOCK_TYPE_ANGLE_BLOCK && cell->block_mode != BLOCK_MODE_FIRST_CELL)
+ continue;
+ d->cell_last_pack=cell->last_sector;
+ if(d->cur_pack<cell->first_sector) {
+ d->cur_pack=cell->first_sector;
break;
}
if(d->cur_pack<=d->cell_last_pack) break; // ok, we find it! :)
- next=dvd_next_cell(d);
- if(next<0) {
- //d->cur_pack=d->cell_last_pack+1;
- break; // we're after the last cell
- }
- d->cur_cell=next;
}
}