Add channel switching delay so stream settles before switching
This commit is contained in:
parent
be4e8b768f
commit
ebe5b4bfcf
3 changed files with 10 additions and 1 deletions
10
src/app.c
10
src/app.c
|
|
@ -12,7 +12,8 @@
|
||||||
#define GUIDE_BROWSE_STEP_MINUTES 30
|
#define GUIDE_BROWSE_STEP_MINUTES 30
|
||||||
#define GUIDE_BROWSE_MAX_AHEAD_MINUTES (12 * 60)
|
#define GUIDE_BROWSE_MAX_AHEAD_MINUTES (12 * 60)
|
||||||
#define GUIDE_BROWSE_MAX_OFFSET_MINUTES (GUIDE_BROWSE_MAX_AHEAD_MINUTES - ((int) (TIMELINE_VISIBLE_SECONDS / 60.0) - 30))
|
#define GUIDE_BROWSE_MAX_OFFSET_MINUTES (GUIDE_BROWSE_MAX_AHEAD_MINUTES - ((int) (TIMELINE_VISIBLE_SECONDS / 60.0) - 30))
|
||||||
#define CHANNEL_BANNER_DURATION_MS 3000
|
#define CHANNEL_BANNER_DURATION_MS 5000
|
||||||
|
#define CHANNEL_SWITCH_LOCK_DURATION_MS 7000
|
||||||
|
|
||||||
static void configure_runtime_environment(void) {
|
static void configure_runtime_environment(void) {
|
||||||
char runtime_dir[64];
|
char runtime_dir[64];
|
||||||
|
|
@ -127,11 +128,18 @@ static int update_video_texture(App *app) {
|
||||||
|
|
||||||
static void tune_relative(App *app, int delta) {
|
static void tune_relative(App *app, int delta) {
|
||||||
int next_index;
|
int next_index;
|
||||||
|
Uint32 now;
|
||||||
|
|
||||||
if (app->channels.count == 0) {
|
if (app->channels.count == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
now = SDL_GetTicks();
|
||||||
|
if (now < app->channel_switch_lock_until) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
app->channel_switch_lock_until = now + CHANNEL_SWITCH_LOCK_DURATION_MS;
|
||||||
|
|
||||||
next_index = app->player.current_index;
|
next_index = app->player.current_index;
|
||||||
if (next_index < 0) {
|
if (next_index < 0) {
|
||||||
next_index = 0;
|
next_index = 0;
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ typedef struct App {
|
||||||
int last_blackout_state;
|
int last_blackout_state;
|
||||||
Uint32 startup_handoff_until;
|
Uint32 startup_handoff_until;
|
||||||
Uint32 channel_banner_until;
|
Uint32 channel_banner_until;
|
||||||
|
Uint32 channel_switch_lock_until;
|
||||||
time_t app_start_time;
|
time_t app_start_time;
|
||||||
Uint64 app_start_ticks;
|
Uint64 app_start_ticks;
|
||||||
int guide_time_offset_minutes;
|
int guide_time_offset_minutes;
|
||||||
|
|
|
||||||
BIN
src/app.o
BIN
src/app.o
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue