Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Openvibe Group
extras
Commits
91217407
Commit
91217407
authored
Mar 07, 2016
by
Jussi Lindgren
Browse files
Plugins: Fixed coefficient parsing check in Spatial Filter box
parent
108add27
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/processing/signal-processing/src/box-algorithms/filters/ovpCBoxAlgorithmSpatialFilter.cpp
View file @
91217407
...
...
@@ -52,7 +52,7 @@ OpenViBE::uint32 CBoxAlgorithmSpatialFilter::loadCoefficients(const OpenViBE::CS
this
->
getLogManager
()
<<
LogLevel_Error
<<
"Number of coefficients expected ("
<<
nRows
*
nCols
<<
") did not match the number counted ("
<<
l_u32count
<<
")
\n
"
;
return
false
;
return
0
;
}
// Resize in one step for efficiency.
...
...
@@ -68,11 +68,6 @@ OpenViBE::uint32 CBoxAlgorithmSpatialFilter::loadCoefficients(const OpenViBE::CS
uint32
l_ui32currentIdx
=
0
;
while
(
*
l_sPtr
!=
0
)
{
if
(
l_ui32currentIdx
>=
l_u32count
)
{
this
->
getLogManager
()
<<
LogLevel_Error
<<
"Parsed too many coefficients
\n
"
;
return
false
;
}
const
int
BUFFSIZE
=
1024
;
char
l_sBuffer
[
BUFFSIZE
];
// Skip separator characters
...
...
@@ -99,6 +94,10 @@ OpenViBE::uint32 CBoxAlgorithmSpatialFilter::loadCoefficients(const OpenViBE::CS
}
l_sBuffer
[
i
]
=
0
;
if
(
l_ui32currentIdx
>=
l_u32count
)
{
this
->
getLogManager
()
<<
LogLevel_Error
<<
"Parsed coefficient number exceeds what we counted before, shouldn't happen
\n
"
;
return
0
;
}
// Finally, convert
if
(
!
sscanf
(
l_sBuffer
,
"%lf"
,
&
l_pFilter
[
l_ui32currentIdx
]))
...
...
@@ -108,7 +107,7 @@ OpenViBE::uint32 CBoxAlgorithmSpatialFilter::loadCoefficients(const OpenViBE::CS
this
->
getLogManager
()
<<
LogLevel_Error
<<
"Error parsing coefficient nr. "
<<
l_ui32currentIdx
<<
" for matrix position ("
<<
l_ui32currentRow
<<
","
<<
l_ui32currentCol
<<
"), stopping.
\n
"
;
b
re
ak
;
re
turn
0
;
}
l_ui32currentIdx
++
;
}
...
...
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