mirror of
https://github.com/panda3d/panda3d.git
synced 2026-05-03 05:01:06 -05:00
ffmpeg: Change thread to use lambda
This commit is contained in:
@@ -274,7 +274,9 @@ start_thread() {
|
||||
|
||||
// Create and start the thread object.
|
||||
_thread_status = TS_wait;
|
||||
_thread = new GenericThread(_filename.get_basename(), _sync_name, st_thread_main, this);
|
||||
_thread = new GenericThread(_filename.get_basename(), _sync_name, [this]{
|
||||
thread_main();
|
||||
});
|
||||
if (!_thread->start(_thread_priority, true)) {
|
||||
// Couldn't start the thread.
|
||||
_thread = nullptr;
|
||||
@@ -668,14 +670,6 @@ cleanup() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The thread main function, static version (for passing to GenericThread).
|
||||
*/
|
||||
void FfmpegVideoCursor::
|
||||
st_thread_main(void *self) {
|
||||
((FfmpegVideoCursor *)self)->thread_main();
|
||||
}
|
||||
|
||||
/**
|
||||
* The thread main function.
|
||||
*/
|
||||
|
||||
@@ -134,7 +134,6 @@ private:
|
||||
|
||||
private:
|
||||
// The following functions will be called in the sub-thread.
|
||||
static void st_thread_main(void *self);
|
||||
void thread_main();
|
||||
bool do_poll();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user