X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=video_widget.cpp;h=126e874aa53b1591e6b53d984a26cfd63a25ad1e;hb=1499d6f5c9c563843c5bba582d44a72c7cae27b2;hp=a5b45136537552282d1ec8c118f5cd998de51adb;hpb=25c11342f6317f8209c0e8fe88b6843ccf50af4f;p=pkanalytics diff --git a/video_widget.cpp b/video_widget.cpp index a5b4513..126e874 100644 --- a/video_widget.cpp +++ b/video_widget.cpp @@ -30,6 +30,8 @@ extern "C" { #include #include +#include "post_to_main_thread.h" + #include #include #include @@ -946,7 +948,9 @@ void VideoWidget::store_pts(int64_t pts) { last_pts = pts; last_position = lrint(pts * double(video_timebase.num) / double(video_timebase.den) * 1000); - emit position_changed(last_position); + post_to_main_thread([this, last_position{last_position.load()}] { + emit position_changed(last_position); + }); } // Taken from Movit (see the comment there for explanation)