From 5457dfdaa1bbdf288f5adfc1dcddc46f6eb3608e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 29 Jul 2018 00:54:54 +0200 Subject: [PATCH] movieplayer/record: stop playback of timeshift when zap to another channel Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d03f201f8bdfeb6db8bc06c87ed5fd2b9a0ab5bb Author: vanhofen Date: 2018-07-29 (Sun, 29 Jul 2018) Origin message was: ------------------ - movieplayer/record: stop playback of timeshift when zap to another channel ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/record.cpp | 4 ++-- src/gui/movieplayer.cpp | 10 ++++++++++ src/gui/movieplayer.h | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index d34f9223d..6befa2a3a 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1155,7 +1155,7 @@ bool CRecordManager::StopAutoRecord(bool lock) g_RCInput->killTimer (shift_timer); - if(!autoshift) + if (!autoshift) return false; if (lock) @@ -1165,7 +1165,7 @@ bool CRecordManager::StopAutoRecord(bool lock) if (inst) { StopInstance(inst); - CMoviePlayerGui::getInstance().timeshift = TSHIFT_MODE_OFF; + CMoviePlayerGui::getInstance().stopTimeshift(); } if (lock) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 147e613ed..682e71897 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1252,6 +1252,16 @@ void CMoviePlayerGui::stopPlayBack(void) printf("%s: stopped\n", __func__); } +void CMoviePlayerGui::stopTimeshift(void) +{ + if (timeshift && playback) + { + printf("%s: stopping timeshift...\n", __func__); + playback->RequestAbort(); + timeshift = TSHIFT_MODE_OFF; + } +} + void CMoviePlayerGui::Pause(bool b) { if (b && (playstate == CMoviePlayerGui::PAUSE)) diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 86219d1df..c59451c75 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -254,6 +254,7 @@ class CMoviePlayerGui : public CMenuTarget void SetFile(std::string &name, std::string &file, std::string info1="", std::string info2="") { pretty_name = name; file_name = file; info_1 = info1; info_2 = info2; } bool PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan, const std::string &script=""); void stopPlayBack(void); + void stopTimeshift(void); void setLastMode(int m) { m_LastMode = m; } void Pause(bool b = true); void selectAudioPid(void);