Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
8be6b010
Commit
8be6b010
authored
Feb 14, 2009
by
Emmanuel Milou
Browse files
Fix the ASLSA capture problem one more time
parent
73df747e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/audio/alsalayer.cpp
View file @
8be6b010
...
...
@@ -134,21 +134,46 @@ AlsaLayer::stopStream(void)
int
AlsaLayer
::
canGetMic
()
{
{
int
avail
;
if
(
!
_CaptureHandle
)
return
0
;
avail
=
snd_pcm_avail_update
(
_CaptureHandle
);
if
(
avail
==
-
EPIPE
)
{
stop_capture
();
return
0
;
}
else
return
((
avail
<
0
)
?
0
:
avail
);
/*
if(_CaptureHandle)
return _micRingBuffer.AvailForGet();
else
return
0
;
return 0;
*/
}
int
AlsaLayer
::
getMic
(
void
*
buffer
,
int
toCopy
)
{
/*
if( _CaptureHandle ){
return _micRingBuffer.Get(buffer, toCopy,100);
}
else
return
0
;
return 0;*/
int
res
=
0
;
if
(
_CaptureHandle
)
{
res
=
read
(
buffer
,
toCopy
);
adjustVolume
(
buffer
,
toCopy
,
SFL_PCM_CAPTURE
);
}
return
res
;
}
bool
AlsaLayer
::
isCaptureActive
(
void
)
{
...
...
@@ -669,7 +694,7 @@ void AlsaLayer::audioCallback (void)
// Additionally handle the mic's audio stream
//if(is_capture_running()){
micAvailAlsa
=
snd_pcm_avail_update
(
_CaptureHandle
);
/*
micAvailAlsa = snd_pcm_avail_update(_CaptureHandle);
if(micAvailAlsa > 0) {
micAvailPut = _micRingBuffer.AvailForPut();
toPut = (micAvailAlsa <= micAvailPut) ? micAvailAlsa : micAvailPut;
...
...
@@ -680,7 +705,7 @@ void AlsaLayer::audioCallback (void)
_micRingBuffer.Put(in, toPut, 100);
}
free(in); in=0;
}
}
*/
}
void
*
AlsaLayer
::
adjustVolume
(
void
*
buffer
,
int
len
,
int
stream
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment