sound.asm: fix counter bug

git-svn-id: svn://kolibrios.org@1697 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2010-11-10 19:18:26 +00:00
parent 4f80db8269
commit 8a4afd01d4
4 changed files with 12 additions and 1 deletions

View File

@ -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]

View File

@ -127,6 +127,7 @@ align 8
.time_base dq ?
.time_stamp dq ?
.last_ts dd ?
.notify_event dd ?
.notify_id dd ?

View File

@ -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]

View File

@ -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