From 24a6ab13fbf9521c2d59a0a49e026b115e1523f3 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 16 Aug 2016 00:00:18 +0200 Subject: [PATCH] Bugfixes. --- src/nvr.c | 4 ++-- src/sound_sb_dsp.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nvr.c b/src/nvr.c index 196cb01f4..69d15a3ad 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -13,7 +13,7 @@ int nvraddr; int nvr_dosave = 0; -static int nvr_onesec_time = 0, nvr_onesec_cnt = 0; +static int64_t nvr_onesec_time = 0, nvr_onesec_cnt = 0; void getnvrtime() { @@ -59,7 +59,7 @@ int nvr_check_alarm(int nvraddr) return (nvrram[nvraddr + 1] == nvrram[nvraddr] || (nvrram[nvraddr + 1] & ALARM_DONTCARE) == ALARM_DONTCARE); } -int nvr_update_end_count = 0; +int64_t nvr_update_end_count = 0; void nvr_update_end(void *p) { diff --git a/src/sound_sb_dsp.c b/src/sound_sb_dsp.c index 7cefaba6d..b5f860d54 100644 --- a/src/sound_sb_dsp.c +++ b/src/sound_sb_dsp.c @@ -161,12 +161,12 @@ void sb_dsp_speed_changed(sb_dsp_t *dsp) if (dsp->sb_timeo < 256) dsp->sblatcho = TIMER_USEC * (256 - dsp->sb_timeo); else - dsp->sblatcho = (int)(TIMER_USEC * (1000000.0f / (float)(dsp->sb_timeo - 256))); + dsp->sblatcho = (int64_t)(TIMER_USEC * (1000000.0f / (float)(dsp->sb_timeo - 256))); if (dsp->sb_timei < 256) dsp->sblatchi = TIMER_USEC * (256 - dsp->sb_timei); else - dsp->sblatchi = (int)(TIMER_USEC * (1000000.0f / (float)(dsp->sb_timei - 256))); + dsp->sblatchi = (int64_t)(TIMER_USEC * (1000000.0f / (float)(dsp->sb_timei - 256))); } void sb_add_data(sb_dsp_t *dsp, uint8_t v) @@ -333,7 +333,7 @@ void sb_exec_command(sb_dsp_t *dsp) case 0x41: /*Set output sampling rate*/ case 0x42: /*Set input sampling rate*/ if (dsp->sb_type < SB16) break; - dsp->sblatcho = (int)(TIMER_USEC * (1000000.0f / (float)(dsp->sb_data[1] + (dsp->sb_data[0] << 8)))); + dsp->sblatcho = (int64_t)(TIMER_USEC * (1000000.0f / (float)(dsp->sb_data[1] + (dsp->sb_data[0] << 8)))); // pclog("Sample rate - %ihz (%i)\n",dsp->sb_data[1]+(dsp->sb_data[0]<<8), dsp->sblatcho); dsp->sb_freq = dsp->sb_data[1] + (dsp->sb_data[0] << 8); dsp->sb_timeo = 256 + dsp->sb_freq;