diff --git a/kernel/trunk/drivers/infinity.asm b/kernel/trunk/drivers/infinity.asm index 283299c4b..2b5d58ebc 100644 --- a/kernel/trunk/drivers/infinity.asm +++ b/kernel/trunk/drivers/infinity.asm @@ -359,6 +359,9 @@ align 4 cmp [edi+out_size], 8 jne .fail + pushfd + cli + xor ebx, ebx push 48 push ebx ; local storage @@ -392,6 +395,7 @@ align 4 @@: mov edi, [edi+output] + emms fild qword [edx+STREAM.time_stamp] fiadd dword [esp] ; primary buffer offset fidiv dword [esp+4] ; total_samples / frequency @@ -399,6 +403,8 @@ align 4 fstp qword [edi] add esp, 8 + popfd + xor eax, eax ret endp @@ -547,6 +553,7 @@ proc CreateBuffer stdcall, format:dword, size:dword mov dword [edi+STREAM.time_stamp], ebx mov dword [edi+STREAM.time_stamp+4], ebx + mov dword [edi+STREAM.last_ts], ebx stdcall AllocPages, dword 64/4 mov edi, [str] diff --git a/kernel/trunk/drivers/main.inc b/kernel/trunk/drivers/main.inc index e1d10b316..75a0c09b0 100644 --- a/kernel/trunk/drivers/main.inc +++ b/kernel/trunk/drivers/main.inc @@ -127,6 +127,7 @@ align 8 .time_base dq ? .time_stamp dq ? + .last_ts dd ? .notify_event dd ? .notify_id dd ? diff --git a/kernel/trunk/drivers/mixer.asm b/kernel/trunk/drivers/mixer.asm index 690f02810..8feb37703 100644 --- a/kernel/trunk/drivers/mixer.asm +++ b/kernel/trunk/drivers/mixer.asm @@ -100,6 +100,7 @@ proc update_streams add dword [esi+STREAM.time_stamp], 4096 adc dword [esi+STREAM.time_stamp+4], 0 + mov dword [esi+STREAM.last_ts], 0 mov eax, [esi+STREAM.out_rp] cmp eax, [esi+STREAM.out_top] diff --git a/kernel/trunk/drivers/sound.asm b/kernel/trunk/drivers/sound.asm index c30c9e762..0fc57564f 100644 --- a/kernel/trunk/drivers/sound.asm +++ b/kernel/trunk/drivers/sound.asm @@ -459,10 +459,12 @@ proc service_proc stdcall, ioctl:dword cmp eax, DEV_GET_POS jne @F - mov ebx, 4096 + mov ebx, 8192 mov edx, 0x18 + xor eax, eax call [ctrl.ctrl_read16] sub ebx, eax + shr ebx, 1 mov edx, [edi+output] mov [edx], ebx xor eax, eax