From fdab9ee5c7eb00a3190d8bcae1ccf7d525926beb Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Mon, 9 Jul 2007 12:30:20 +0000 Subject: [PATCH] fix 2_16_48 stream git-svn-id: svn://kolibrios.org@575 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/drivers/infinity.asm | 6 +-- kernel/trunk/drivers/mixer.asm | 77 +------------------------------ 2 files changed, 4 insertions(+), 79 deletions(-) diff --git a/kernel/trunk/drivers/infinity.asm b/kernel/trunk/drivers/infinity.asm index 7fcb3bf709..f010f80dfb 100644 --- a/kernel/trunk/drivers/infinity.asm +++ b/kernel/trunk/drivers/infinity.asm @@ -647,7 +647,7 @@ proc wave_out stdcall, str:dword,src:dword,size:dword jz .fail cmp esi, OS_BASE - ja .fail + jae .fail mov [state_saved], 0 @@ -717,8 +717,8 @@ proc wave_out stdcall, str:dword,src:dword,size:dword @@: stdcall refill, edx .skip: - mov ebx, [str] - mov [ebx+STREAM.flags], SND_PLAY + mov edx, [str] + mov [edx+STREAM.flags], SND_PLAY cmp [eng_state], SND_PLAY je .main_loop diff --git a/kernel/trunk/drivers/mixer.asm b/kernel/trunk/drivers/mixer.asm index 47ae529c3b..70eef95901 100644 --- a/kernel/trunk/drivers/mixer.asm +++ b/kernel/trunk/drivers/mixer.asm @@ -89,9 +89,6 @@ proc update_stream @@: mov [esi+STREAM.out_rp], eax - cmp word [esi+STREAM.format], PCM_2_16_48 - je .copy - cmp [esi+STREAM.out_count], 16384 ja .skip @@ -104,81 +101,9 @@ proc update_stream dec [play_count] jnz .l1 ret - .ring: stdcall refill_ring, esi jmp .skip -.copy: - mov ebx, esi - mov esi, [ebx+STREAM.in_rp] - mov edi, [ebx+STREAM.out_wp] - cmp edi, [ebx+STREAM.out_top] - jb @f - - sub edi, 64*1024 - mov [ebx+STREAM.out_wp], edi -@@: - test [ebx+STREAM.format], PCM_RING - jnz .stream - - mov ecx, [ebx+STREAM.in_count] - test ecx, ecx - jz .done - - cmp ecx, 16384 - jbe @F - mov ecx, 16386 -@@: - sub [ebx+STREAM.in_count], ecx -.stream: - add [ebx+STREAM.in_free], ecx - add [ebx+STREAM.out_count], ecx - - shr ecx, 2 - cld - rep movsd - - mov [ebx+STREAM.out_wp], edi - cmp esi, [ebx+STREAM.in_top] - jb @f - - sub esi, [ebx+STREAM.in_size] -@@: - mov [ebx+STREAM.in_rp], esi - test [ebx+STREAM.format], PCM_RING - jz .done - - sub esi, [ebx+STREAM.in_base] - sub esi, 128 - lea edx, [event] - - mov dword [edx], RT_INP_EMPTY - mov dword [edx+4], 0 - mov dword [edx+8], ebx - mov dword [edx+12], esi - - mov eax, [ebx+STREAM.notify_event] - test eax, eax - jz .l_end - - mov ebx, [ebx+STREAM.notify_id] - xor ecx, ecx - call RaiseEvent ;eax, ebx, ecx, edx - jmp .l_end -.done: - mov eax, [ebx+STREAM.notify_event] - test eax, eax - jz .l_end - - mov ebx, [ebx+STREAM.notify_id] - mov ecx, EVENT_WATCHED - xor edx, edx - call RaiseEvent ;eax, ebx, ecx, edx -.l_end: - inc [stream_index] - dec [play_count] - jnz .l1 - ret endp align 4 @@ -489,8 +414,8 @@ proc copy_stream stdcall, dest:dword,src:dword,\ shr ecx, 2 mov esi, [src] mov edi, [dest] + cld rep movsd - mov eax, 16384 ret endp