Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
linux-elphel
Commits
85e1d930
Commit
85e1d930
authored
Nov 02, 2016
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix incorrect _FREE and _USED circbuff calculation
parent
6b6d9d20
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
circbuf.c
src/drivers/elphel/circbuf.c
+2
-1
No files found.
src/drivers/elphel/circbuf.c
View file @
85e1d930
...
...
@@ -617,7 +617,8 @@ loff_t circbuf_lseek(struct file * file, loff_t offset, int orig) {
case
LSEEK_CIRC_USED
:
bp
=
((
camSeqGetJPEG_wp
(
chn
)
<<
2
)
-
file
->
f_pos
);
// return (bp>=0)?bp:(bp+l); //!will return 0 if current pointer is a write pointer (waiting for the next frame)
return
(
file
->
f_pos
=
(
bp
>
0
)
?
bp
:
(
bp
+
circbuf_priv_ptr
[
chn
].
buf_size
));
//!Has a side effect of moving a file pointer!
// the condition below was (bp>0), but this resulted in the same _FREE and _USED sizes reported when file and HW pointers are equal
return
(
file
->
f_pos
=
(
bp
>=
0
)
?
bp
:
(
bp
+
circbuf_priv_ptr
[
chn
].
buf_size
));
//!Has a side effect of moving a file pointer!
case
LSEEK_CIRC_TORP
:
break
;
case
LSEEK_CIRC_TOWP
:
...
...
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