Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
timeshift: fix the time offset when speed changes
  • Loading branch information
perexg committed Jan 4, 2016
1 parent b3870dd commit d77186d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/timeshift/timeshift_reader.c
Expand Up @@ -634,18 +634,20 @@ void *timeshift_reader ( void *p )
}

/* Update */
cur_speed = speed;
if (speed != 100 || state != TS_LIVE) {
ts->state = speed == 0 ? TS_PAUSE : TS_PLAY;
tvhtrace("timeshift", "reader - set %s", speed == 0 ? "TS_PAUSE" : "TS_PLAY");
}
if (ts->state == TS_PLAY && state != TS_PLAY) {
if ((ts->state == TS_PLAY && state != TS_PLAY) || (speed != cur_speed)) {
mono_play_time = mono_now;
tvhtrace("timeshift", "update play time TS_LIVE - %"PRId64" play buffer from %"PRId64,
mono_now, pause_time);
if (speed != cur_speed)
pause_time = last_time;
} else if (ts->state == TS_PAUSE && state != TS_PAUSE) {
pause_time = last_time;
}
cur_speed = speed;
tvhlog(LOG_DEBUG, "timeshift", "ts %d change speed %d", ts->id, speed);
}

Expand Down

0 comments on commit d77186d

Please sign in to comment.