comparison stream/stream_dvd.c @ 31817:cb769a111f7a

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
author diego
date Sun, 01 Aug 2010 22:53:09 +0000
parents ab9824b6acc7
children c52e80f24086
comparison
equal deleted inserted replaced
31816:ab9824b6acc7 31817:cb769a111f7a
378 // check if we stay in current cell (speedup things, and avoid angle skip) 378 // check if we stay in current cell (speedup things, and avoid angle skip)
379 if(d->cur_pack>d->cell_last_pack || 379 if(d->cur_pack>d->cell_last_pack ||
380 d->cur_pack<d->cur_pgc->cell_playback[ d->cur_cell ].first_sector) { 380 d->cur_pack<d->cur_pgc->cell_playback[ d->cur_cell ].first_sector) {
381 381
382 // ok, cell change, find the right cell! 382 // ok, cell change, find the right cell!
383 d->cur_cell=0; 383 cell_playback_t *cell;
384 if(d->cur_pgc->cell_playback[d->cur_cell].block_type == BLOCK_TYPE_ANGLE_BLOCK ) 384 for(d->cur_cell=0; d->cur_cell < d->cur_pgc->nr_of_cells; d->cur_cell++) {
385 d->cur_cell+=dvd_angle; 385 cell = &(d->cur_pgc->cell_playback[d->cur_cell]);
386 386 if(cell->block_type == BLOCK_TYPE_ANGLE_BLOCK && cell->block_mode != BLOCK_MODE_FIRST_CELL)
387 while(1) { 387 continue;
388 int next; 388 d->cell_last_pack=cell->last_sector;
389 d->cell_last_pack=d->cur_pgc->cell_playback[ d->cur_cell ].last_sector; 389 if(d->cur_pack<cell->first_sector) {
390 if(d->cur_pack<d->cur_pgc->cell_playback[ d->cur_cell ].first_sector) { 390 d->cur_pack=cell->first_sector;
391 d->cur_pack=d->cur_pgc->cell_playback[ d->cur_cell ].first_sector;
392 break; 391 break;
393 } 392 }
394 if(d->cur_pack<=d->cell_last_pack) break; // ok, we find it! :) 393 if(d->cur_pack<=d->cell_last_pack) break; // ok, we find it! :)
395 next=dvd_next_cell(d);
396 if(next<0) {
397 //d->cur_pack=d->cell_last_pack+1;
398 break; // we're after the last cell
399 }
400 d->cur_cell=next;
401 } 394 }
402 } 395 }
403 396
404 mp_msg(MSGT_DVD,MSGL_V, "DVD Seek! lba=0x%X cell=%d packs: 0x%X-0x%X \n", 397 mp_msg(MSGT_DVD,MSGL_V, "DVD Seek! lba=0x%X cell=%d packs: 0x%X-0x%X \n",
405 d->cur_pack,d->cur_cell,d->cur_pgc->cell_playback[ d->cur_cell ].first_sector,d->cell_last_pack); 398 d->cur_pack,d->cur_cell,d->cur_pgc->cell_playback[ d->cur_cell ].first_sector,d->cell_last_pack);