Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
f18f7d6c
Commit
f18f7d6c
authored
12 years ago
by
Tristan Matthews
Browse files
Options
Downloads
Patches
Plain Diff
* #9897: audiorecord cleanup
parent
fb2671d0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
daemon/src/audio/audiorecord.cpp
+3
-3
3 additions, 3 deletions
daemon/src/audio/audiorecord.cpp
daemon/src/audio/audiorecord.h
+1
-1
1 addition, 1 deletion
daemon/src/audio/audiorecord.h
daemon/src/audio/audiorecorder.cpp
+4
-5
4 additions, 5 deletions
daemon/src/audio/audiorecorder.cpp
with
8 additions
and
9 deletions
daemon/src/audio/audiorecord.cpp
+
3
−
3
View file @
f18f7d6c
...
...
@@ -392,7 +392,7 @@ void AudioRecord::closeWavFile()
WARN
(
"AudioRecord: Error: can't close file"
);
}
void
AudioRecord
::
recData
(
SFLDataFormat
*
buffer
,
in
t
nSamples
)
void
AudioRecord
::
recData
(
SFLDataFormat
*
buffer
,
size_
t
nSamples
)
{
if
(
recordingEnabled_
)
{
if
(
fileHandle_
==
0
)
{
...
...
@@ -400,11 +400,11 @@ void AudioRecord::recData(SFLDataFormat* buffer, int nSamples)
return
;
}
if
(
fwrite
(
buffer
,
sizeof
(
SFLDataFormat
),
nSamples
,
fileHandle_
)
!=
(
unsigned
int
)
nSamples
)
if
(
fwrite
(
buffer
,
sizeof
(
SFLDataFormat
),
nSamples
,
fileHandle_
)
!=
nSamples
)
WARN
(
"AudioRecord: Could not record data! "
);
else
{
fflush
(
fileHandle_
);
byteCounter_
+=
(
unsigned
long
)(
nSamples
*
sizeof
(
SFLDataFormat
)
)
;
byteCounter_
+=
nSamples
*
sizeof
(
SFLDataFormat
);
}
}
}
This diff is collapsed.
Click to expand it.
daemon/src/audio/audiorecord.h
+
1
−
1
View file @
f18f7d6c
...
...
@@ -102,7 +102,7 @@ class AudioRecord {
* @param buffer The data chunk to be recorded
* @param nSamples Number of samples (number of bytes) to be recorded
*/
void
recData
(
SFLDataFormat
*
buffer
,
in
t
nSamples
);
void
recData
(
SFLDataFormat
*
buffer
,
size_
t
nSamples
);
protected
:
...
...
This diff is collapsed.
Click to expand it.
daemon/src/audio/audiorecorder.cpp
+
4
−
5
View file @
f18f7d6c
...
...
@@ -58,14 +58,13 @@ AudioRecorder::AudioRecorder(AudioRecord *arec, MainBuffer *mb) : ost::Thread()
*/
void
AudioRecorder
::
run
()
{
int
bufferLength
=
10000
;
SFLDataFormat
buffer
[
bufferLength
];
const
size_t
BUFFER_LENGTH
=
10000
;
SFLDataFormat
buffer
[
BUFFER_LENGTH
];
while
(
isRunning
())
{
int
availBytes
=
mbuffer_
->
availForGet
(
recorderId_
);
int
toGet
=
(
availBytes
<
bufferLength
)
?
availBytes
:
bufferLength
;
size_t
availBytes
=
mbuffer_
->
availForGet
(
recorderId_
);
mbuffer_
->
getData
(
buffer
,
toGet
,
recorderId_
);
mbuffer_
->
getData
(
buffer
,
std
::
min
(
availBytes
,
BUFFER_LENGTH
)
,
recorderId_
);
if
(
availBytes
>
0
)
arecord_
->
recData
(
buffer
,
availBytes
/
sizeof
(
SFLDataFormat
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment