Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-apps-camogm
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-apps-camogm
Commits
b50eb743
Commit
b50eb743
authored
Jun 09, 2017
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicate variable counting audio frames
parent
517e104b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
5 deletions
+1
-5
camogm_audio.c
src/camogm_audio.c
+1
-4
camogm_audio.h
src/camogm_audio.h
+0
-1
No files found.
src/camogm_audio.c
View file @
b50eb743
...
@@ -128,7 +128,6 @@ void audio_init(struct audio *audio, bool restart)
...
@@ -128,7 +128,6 @@ void audio_init(struct audio *audio, bool restart)
audio
->
ctx_a
.
begin_of_stream_with_audio
=
1
;
audio
->
ctx_a
.
begin_of_stream_with_audio
=
1
;
audio
->
ctx_a
.
audio_trigger
=
1
;
audio
->
ctx_a
.
audio_trigger
=
1
;
audio
->
ctx_a
.
audio_count
=
0
;
audio
->
ctx_a
.
audio_skip_samples
=
0
;
audio
->
ctx_a
.
audio_skip_samples
=
0
;
struct
timeval
fpga_tv
,
sys_tv
;
struct
timeval
fpga_tv
,
sys_tv
;
...
@@ -169,7 +168,6 @@ void audio_start(struct audio *audio)
...
@@ -169,7 +168,6 @@ void audio_start(struct audio *audio)
audio
->
ctx_a
.
rem_samples
=
0
;
audio
->
ctx_a
.
rem_samples
=
0
;
audio
->
ctx_a
.
time_last
.
tv_sec
=
0
;
audio
->
ctx_a
.
time_last
.
tv_sec
=
0
;
audio
->
ctx_a
.
time_last
.
tv_usec
=
0
;
audio
->
ctx_a
.
time_last
.
tv_usec
=
0
;
audio
->
ctx_a
.
audio_count
=
0
;
}
}
/**
/**
...
@@ -297,14 +295,13 @@ void audio_process(struct audio *audio)
...
@@ -297,14 +295,13 @@ void audio_process(struct audio *audio)
}
}
if
(
flag
)
{
if
(
flag
)
{
long
samples
=
slen
-
offset
;
long
samples
=
slen
-
offset
;
audio
->
ctx_a
.
audio_count
+=
samples
;
_buf
=
(
void
*
)
audio
->
ctx_a
.
sbuffer
;
_buf
=
(
void
*
)
audio
->
ctx_a
.
sbuffer
;
_buf
=
(
void
*
)((
char
*
)
_buf
+
offset
*
audio
->
audio_channels
*
(
snd_pcm_format_physical_width
(
audio
->
audio_format
)
/
8
));
_buf
=
(
void
*
)((
char
*
)
_buf
+
offset
*
audio
->
audio_channels
*
(
snd_pcm_format_physical_width
(
audio
->
audio_format
)
/
8
));
_buf_len
=
samples
*
audio
->
audio_channels
*
(
snd_pcm_format_physical_width
(
audio
->
audio_format
)
/
8
);
_buf_len
=
samples
*
audio
->
audio_channels
*
(
snd_pcm_format_physical_width
(
audio
->
audio_format
)
/
8
);
audio
->
write_samples
(
audio
,
_buf
,
_buf_len
,
samples
);
audio
->
write_samples
(
audio
,
_buf
,
_buf_len
,
samples
);
float
tr
=
1
.
0
/
audio
->
audio_rate
;
float
tr
=
1
.
0
/
audio
->
audio_rate
;
float
l
=
tr
*
audio
->
ctx_a
.
audio_count
;
float
l
=
tr
*
audio
->
audio_samples
;
unsigned
long
s
=
(
unsigned
long
)
l
;
unsigned
long
s
=
(
unsigned
long
)
l
;
l
-=
s
;
l
-=
s
;
l
*=
1000000
;
l
*=
1000000
;
...
...
src/camogm_audio.h
View file @
b50eb743
...
@@ -40,7 +40,6 @@ struct context_audio {
...
@@ -40,7 +40,6 @@ struct context_audio {
char
*
sbuffer
;
///< buffer for audio samples
char
*
sbuffer
;
///< buffer for audio samples
long
sbuffer_len
;
///< the length of samples buffer in samples
long
sbuffer_len
;
///< the length of samples buffer in samples
long
sample_time
;
///< duration of one chunk of audio data, in ms
long
sample_time
;
///< duration of one chunk of audio data, in ms
long
long
audio_count
;
///< total number of audio frames
struct
timeval
time_start
;
///< start time, set only when stream starts and updated with each new file
struct
timeval
time_start
;
///< start time, set only when stream starts and updated with each new file
struct
timeval
time_last
;
///< calculated time of last audio sample (this value is not taken from ALSA)
struct
timeval
time_last
;
///< calculated time of last audio sample (this value is not taken from ALSA)
...
...
Write
Preview
Markdown
is supported
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