mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 15:22:09 +00:00
stream_dvd: fix dvd_get_current_time()
Fix dvd_get_current_time so the cell argument actually has a purpose. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33603 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
81c227d221
commit
d84c42b09f
@ -534,8 +534,8 @@ static double dvd_get_current_time(stream_t *stream, int cell)
|
|||||||
dvd_priv_t *d = stream->priv;
|
dvd_priv_t *d = stream->priv;
|
||||||
|
|
||||||
tm=0;
|
tm=0;
|
||||||
if(!cell) cell=d->cur_cell;
|
if(cell < 0) cell=d->cur_cell;
|
||||||
for(i=0; i<d->cur_cell; i++) {
|
for(i=0; i<cell; i++) {
|
||||||
if(d->cur_pgc->cell_playback[i].block_type == BLOCK_TYPE_ANGLE_BLOCK &&
|
if(d->cur_pgc->cell_playback[i].block_type == BLOCK_TYPE_ANGLE_BLOCK &&
|
||||||
d->cur_pgc->cell_playback[i].block_mode != BLOCK_MODE_FIRST_CELL
|
d->cur_pgc->cell_playback[i].block_mode != BLOCK_MODE_FIRST_CELL
|
||||||
)
|
)
|
||||||
@ -585,7 +585,7 @@ static int dvd_seek_to_time(stream_t *stream, ifo_handle_t *vts_file, double sec
|
|||||||
stream_skip(stream, 2048);
|
stream_skip(stream, 2048);
|
||||||
t = mp_dvdtimetomsec(&d->dsi_pack.dsi_gi.c_eltm);
|
t = mp_dvdtimetomsec(&d->dsi_pack.dsi_gi.c_eltm);
|
||||||
} while(!t);
|
} while(!t);
|
||||||
tm = dvd_get_current_time(stream, 0);
|
tm = dvd_get_current_time(stream, -1);
|
||||||
|
|
||||||
pos = ((off_t)tmap_sector)<<11;
|
pos = ((off_t)tmap_sector)<<11;
|
||||||
stream_seek(stream, pos);
|
stream_seek(stream, pos);
|
||||||
@ -594,7 +594,7 @@ static int dvd_seek_to_time(stream_t *stream, ifo_handle_t *vts_file, double sec
|
|||||||
while(tm <= sec) {
|
while(tm <= sec) {
|
||||||
if(!stream_skip(stream, 2048))
|
if(!stream_skip(stream, 2048))
|
||||||
break;
|
break;
|
||||||
tm = dvd_get_current_time(stream, 0);
|
tm = dvd_get_current_time(stream, -1);
|
||||||
};
|
};
|
||||||
tmap_sector = stream->pos >> 11;
|
tmap_sector = stream->pos >> 11;
|
||||||
|
|
||||||
@ -645,7 +645,7 @@ static int control(stream_t *stream,int cmd,void* arg)
|
|||||||
case STREAM_CTRL_GET_CURRENT_TIME:
|
case STREAM_CTRL_GET_CURRENT_TIME:
|
||||||
{
|
{
|
||||||
double tm;
|
double tm;
|
||||||
tm = dvd_get_current_time(stream, 0);
|
tm = dvd_get_current_time(stream, -1);
|
||||||
if(tm != -1) {
|
if(tm != -1) {
|
||||||
*((double *)arg) = tm;
|
*((double *)arg) = tm;
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user