aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-06 17:38:05 +0200
committerdec05eba <dec05eba@protonmail.com>2019-08-06 17:38:08 +0200
commitc11d8f861b0e260240ec59c423cdb440d7409ac1 (patch)
tree13642d35913f9bee0fd1b5ab9958bfeb805e3df0
parent31ac4c0061f0c34b99ddf2643e912efa5549d0bd (diff)
Fix black video after next video plays
-rw-r--r--README.md3
-rw-r--r--src/VideoPlayer.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/README.md b/README.md
index 544167b..a618000 100644
--- a/README.md
+++ b/README.md
@@ -18,4 +18,5 @@ For manga, view the next chapter when reaching the end of a chapter.
Make network requests asynchronous to not freeze gui when navigating. Also have loading animation.
Retain search text when navigating back.
Disable ytdl_hook subtitles. If a video has subtitles for many languages, then it will stall video playback for several seconds
-until all subtitles have been downloaded and loaded. \ No newline at end of file
+until all subtitles have been downloaded and loaded.
+Figure out why memory usage doesn't drop much when killing the video player. Is it a bug in proprietary nvidia drivers on gnu/linux? \ No newline at end of file
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index 7ce5f19..41b6d0e 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -185,6 +185,8 @@ namespace QuickMedia {
{
video_size.x = w;
video_size.y = h;
+ context.reset(new sf::Context(sf::ContextSettings(), w, h));
+ context->setActive(true);
// TODO: Verify if it's valid to re-create the texture like this,
// instead of using deconstructor
if(texture.create(w, h)) {
@@ -192,8 +194,6 @@ namespace QuickMedia {
if(newTextureBuf)
textureBuffer = (sf::Uint8*)newTextureBuf;
}
- context.reset(new sf::Context(sf::ContextSettings(), w, h));
- context->setActive(true);
glViewport(0, 0, w, h);
context->setActive(false);
resize(desired_size);