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
23bac812
Commit
23bac812
authored
Apr 28, 2017
by
Mikhail Karpenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error with crossing disk boundary
parent
a834b990
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
camogm_align.c
src/camogm_align.c
+1
-1
camogm_jpeg.c
src/camogm_jpeg.c
+5
-1
No files found.
src/camogm_align.c
View file @
23bac812
...
...
@@ -459,7 +459,7 @@ int update_lba(camogm_state *state)
if
(
state
->
writer_params
.
lba_current
+
total_sz
<=
state
->
writer_params
.
lba_end
)
{
state
->
writer_params
.
lba_current
+=
total_sz
;
}
else
{
state
->
writer_params
.
lba_current
=
state
->
writer_params
.
lba_start
;
state
->
writer_params
.
lba_current
=
state
->
writer_params
.
lba_start
+
total_sz
;
ret
=
1
;
}
...
...
src/camogm_jpeg.c
View file @
23bac812
...
...
@@ -407,6 +407,7 @@ int camogm_end_jpeg(camogm_state *state)
*/
void
*
jpeg_writer
(
void
*
thread_args
)
{
int
reset_rem
;
int
chunk_index
;
ssize_t
iovlen
,
l
;
bool
process
=
true
;
...
...
@@ -443,6 +444,7 @@ void *jpeg_writer(void *thread_args)
/* end of dummy read cycle */
l
=
0
;
reset_rem
=
0
;
state
->
writer_params
.
last_ret_val
=
0
;
chunk_index
=
get_data_buffers
(
state
,
chunks_iovec
,
FILE_CHUNKS_NUM
);
if
(
chunk_index
>
0
)
{
...
...
@@ -452,6 +454,7 @@ void *jpeg_writer(void *thread_args)
if
(
iovlen
<
l
)
{
D0
(
fprintf
(
debug_file
,
"writev error: %s (returned %i, expected %i)
\n
"
,
strerror
(
errno
),
iovlen
,
l
));
state
->
writer_params
.
last_ret_val
=
-
CAMOGM_FRAME_FILE_ERR
;
reset_rem
=
1
;
}
else
{
// update statistic
state
->
rawdev
.
last_jpeg_size
=
l
;
...
...
@@ -461,10 +464,11 @@ void *jpeg_writer(void *thread_args)
}
else
{
D0
(
fprintf
(
debug_file
,
"data vector mapping error: %d)
\n
"
,
chunk_index
));
state
->
writer_params
.
last_ret_val
=
-
CAMOGM_FRAME_FILE_ERR
;
reset_rem
=
1
;
}
// release main thread
reset_chunks
(
state
->
writer_params
.
data_chunks
,
0
);
reset_chunks
(
state
->
writer_params
.
data_chunks
,
reset_rem
);
params
->
data_ready
=
false
;
pthread_cond_signal
(
&
params
->
main_cond
);
}
...
...
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