Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ofxaddons
ofxCloudLib
Commits
ed930c17
Commit
ed930c17
authored
Jan 12, 2018
by
artificiel
Browse files
CloudPlayerThread: correction sur les conditions de fin de thread
parent
470a60d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ofxCloudLib/CloudPlayerThread.hpp
View file @
ed930c17
...
...
@@ -78,7 +78,7 @@ class CloudPlayerThread : public ofThread
new_mesh_
=
false
;
while
(
recorded_mesh_
.
tryReceive
(
mesh_
[(
ready_mesh_buffer_
+
1
)
%
NUM_CLOUD_BUFFERS
]))
{
new_mesh_
=
true
;
new_mesh_
=
true
;
ready_mesh_buffer_
=
(
ready_mesh_buffer_
+
1
)
%
NUM_CLOUD_BUFFERS
;
}
if
(
new_mesh_
)
{
...
...
@@ -88,21 +88,27 @@ class CloudPlayerThread : public ofThread
bool
is_cloud_new
()
{
return
new_cloud_
;
}
bool
is_mesh_new
()
{
return
new_mesh_
;
}
ofMesh
&
get_mesh
()
{
return
mesh_
[
ready_mesh_buffer_
];
}
ofMesh
&
get_mesh
()
{
if
(
!
isThreadRunning
()
&&
mesh_
[
ready_mesh_buffer_
].
getNumVertices
()
!=
0
)
{
mesh_
[
ready_mesh_buffer_
].
clear
();
}
return
mesh_
[
ready_mesh_buffer_
];
}
float
offset_x_
,
offset_z_
;
void
stop
()
{
if
(
isThreadRunning
())
{
if
(
isThreadRunning
())
{
ofLogNotice
(
"CloudPlayerThread"
)
<<
"stopped_thread is now true"
;
stop_thread_
=
true
;
}
else
{
ofLogNotice
(
"CloudPlayerThread"
)
<<
"double-stop prevented"
;
}
}
}
std
::
string
get_filename
()
...
...
@@ -110,6 +116,8 @@ class CloudPlayerThread : public ofThread
return
filename_
;
}
bool
is_done_
=
false
;
private:
void
threadedFunction
()
{
...
...
@@ -133,6 +141,8 @@ class CloudPlayerThread : public ofThread
ofLogNotice
(
"CloudPlayerThread"
)
<<
"stopping the thread"
;
stop_thread_
=
false
;
new_cloud_
=
false
;
stopThread
();
ofLogNotice
(
"CloudPlayerThread"
)
<<
"thread stopped"
;
return
;
...
...
@@ -158,6 +168,7 @@ class CloudPlayerThread : public ofThread
stop
();
// stop_thread_ = true;
// if looping....
is_done_
=
true
;
decoded_frames_
=
0
;
}
else
{
...
...
@@ -209,6 +220,7 @@ class CloudPlayerThread : public ofThread
uint64_t
decodingFenceTimestamp
=
0
;
uint64_t
delay
;
std
::
string
filename_
;
std
::
string
playback_path_
;
bool
new_mesh_
=
false
;
...
...
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