: VideoView (viewer)
, _have_storage (false)
, _vsync_enabled (false)
- , _thread (0)
, _playing (false)
, _one_shot (false)
{
GLVideoView::~GLVideoView ()
{
- _thread->interrupt ();
- _thread->join ();
- delete _thread;
+ try {
+ _thread.interrupt ();
+ _thread.join ();
+ } catch (...) {
+
+ }
glDeleteTextures (1, &_id);
}
void
GLVideoView::check_for_butler_errors ()
{
+ if (!_viewer->butler()) {
+ return;
+ }
+
try {
_viewer->butler()->rethrow ();
} catch (DecodeError& e) {
void
GLVideoView::create ()
{
- if (!_thread) {
- _thread = new boost::thread (boost::bind(&GLVideoView::thread, this));
+ if (!_thread.joinable()) {
+ _thread = boost::thread (boost::bind(&GLVideoView::thread, this));
}
}