From 5cd42eb2049e1ef4665fd19de04ebcac160fc7aa Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 25 Feb 2012 13:24:22 +0100 Subject: [PATCH] spark: make cVideo::SetVideoSystem more robust in order to not run into driver locking issues, stop video decoding before setting the video system and restart afterwards --- libspark/video.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libspark/video.cpp b/libspark/video.cpp index 776c6eb..46a74e3 100644 --- a/libspark/video.cpp +++ b/libspark/video.cpp @@ -276,9 +276,18 @@ int cVideo::SetVideoSystem(int video_system, bool remember) lt_info("%s: video_system (%d) > VIDEO_STD_MAX (%d)\n", __func__, video_system, VIDEO_STD_MAX); return -1; } + bool stopped = false; + if (playstate == VIDEO_PLAYING) + { + lt_info("%s: playstate == VIDEO_PLAYING, stopping video\n", __func__); + Stop(); + stopped = true; + } hdmi_out(false); int ret = proc_put("/proc/stb/video/videomode", modes[video_system],strlen(modes[video_system])); hdmi_out(true); + if (stopped) + Start(); return ret; }