Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
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
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
cacdc382
Commit
cacdc382
authored
Dec 04, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problems with non-thread-safe code being run in ThreadPool.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
1a1a4930
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
wmspeed.cc
src/wmspeed.cc
+7
-5
No files found.
src/wmspeed.cc
View file @
cacdc382
...
@@ -165,14 +165,20 @@ private:
...
@@ -165,14 +165,20 @@ private:
const
double
step
;
const
double
step
;
const
int
n_steps
;
const
int
n_steps
;
const
double
seconds
;
const
double
seconds
;
const
int
frames_per_block
;
public
:
public
:
SpeedSync
(
const
WavData
&
in_data
,
double
center
,
double
step
,
int
n_steps
,
double
seconds
)
:
SpeedSync
(
const
WavData
&
in_data
,
double
center
,
double
step
,
int
n_steps
,
double
seconds
)
:
in_data
(
in_data
),
in_data
(
in_data
),
center
(
center
),
center
(
center
),
step
(
step
),
step
(
step
),
n_steps
(
n_steps
),
n_steps
(
n_steps
),
seconds
(
seconds
)
seconds
(
seconds
),
frames_per_block
(
mark_sync_frame_count
()
+
mark_data_frame_count
())
{
{
// constructor is run in the main thread; everything that is not thread-safe must happen here
SyncFinder
sync_finder
;
sync_bits
=
sync_finder
.
get_sync_bits
(
in_data
,
SyncFinder
::
Mode
::
BLOCK
);
}
}
void
void
prepare_job
(
ThreadPool
&
thread_pool
)
prepare_job
(
ThreadPool
&
thread_pool
)
...
@@ -290,9 +296,6 @@ SpeedSync::prepare_mags()
...
@@ -290,9 +296,6 @@ SpeedSync::prepare_mags()
window
[
i
]
*=
2.0
/
window_weight
;
window
[
i
]
*=
2.0
/
window_weight
;
}
}
SyncFinder
sync_finder
;
sync_bits
=
sync_finder
.
get_sync_bits
(
in_data
,
SyncFinder
::
Mode
::
BLOCK
);
FFTProcessor
fft_processor
(
sub_frame_size
);
FFTProcessor
fft_processor
(
sub_frame_size
);
float
*
in
=
fft_processor
.
in
();
float
*
in
=
fft_processor
.
in
();
...
@@ -346,7 +349,6 @@ SpeedSync::prepare_mags()
...
@@ -346,7 +349,6 @@ SpeedSync::prepare_mags()
void
void
SpeedSync
::
compare
(
double
relative_speed
)
SpeedSync
::
compare
(
double
relative_speed
)
{
{
const
int
frames_per_block
=
mark_sync_frame_count
()
+
mark_data_frame_count
();
const
int
pad_start
=
frames_per_block
*
/* HACK */
4
;
const
int
pad_start
=
frames_per_block
*
/* HACK */
4
;
Score
best_score
;
Score
best_score
;
// FIXME: pad_start must be scaled with speed
// FIXME: pad_start must be scaled with speed
...
...
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