mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
- movieplayer/record: move timeshift deletion code to moviebrowser ...
... to get sure it's not deleted until playback is stopped Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -318,20 +318,16 @@ bool CRecordInstance::Stop(bool remove_event)
|
|||||||
if(!autoshift)
|
if(!autoshift)
|
||||||
CFEManager::getInstance()->unlockFrontend(frontend, true);//FIXME testing
|
CFEManager::getInstance()->unlockFrontend(frontend, true);//FIXME testing
|
||||||
|
|
||||||
CCamManager::getInstance()->Stop(channel_id, CCamManager::RECORD);
|
CCamManager::getInstance()->Stop(channel_id, CCamManager::RECORD);
|
||||||
|
|
||||||
|
if (autoshift && g_settings.auto_delete)
|
||||||
|
CMoviePlayerGui::getInstance().deleteTimeshift();
|
||||||
|
|
||||||
if((autoshift && g_settings.auto_delete) /* || autoshift_delete*/) {
|
|
||||||
snprintf(buf,sizeof(buf), "nice -n 20 rm -f \"%s.ts\" &", filename);
|
|
||||||
my_system(3, "/bin/sh", "-c", buf);
|
|
||||||
snprintf(buf,sizeof(buf), "%s.xml", filename);
|
|
||||||
//autoshift_delete = false;
|
|
||||||
unlink(buf);
|
|
||||||
}
|
|
||||||
if(recording_id && remove_event) {
|
if(recording_id && remove_event) {
|
||||||
g_Timerd->stopTimerEvent(recording_id);
|
g_Timerd->stopTimerEvent(recording_id);
|
||||||
recording_id = 0;
|
recording_id = 0;
|
||||||
}
|
}
|
||||||
//CVFD::getInstance()->ShowIcon(VFD_ICON_CAM1, false);
|
//CVFD::getInstance()->ShowIcon(VFD_ICON_CAM1, false);
|
||||||
WaitRecMsg(end_time, 2);
|
WaitRecMsg(end_time, 2);
|
||||||
hintBox.hide();
|
hintBox.hide();
|
||||||
return true;
|
return true;
|
||||||
|
@@ -596,6 +596,7 @@ void CMoviePlayerGui::Cleanup()
|
|||||||
is_file_player = false;
|
is_file_player = false;
|
||||||
p_movie_info = NULL;
|
p_movie_info = NULL;
|
||||||
autoshot_done = false;
|
autoshot_done = false;
|
||||||
|
timeshift_deletion = false;
|
||||||
currentaudioname = "Unk";
|
currentaudioname = "Unk";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2033,6 +2034,21 @@ void CMoviePlayerGui::PlayFileEnd(bool restore)
|
|||||||
|
|
||||||
stopped = true;
|
stopped = true;
|
||||||
printf("%s: stopped\n", __func__);
|
printf("%s: stopped\n", __func__);
|
||||||
|
|
||||||
|
if (timeshift_deletion && (file_name.find("_temp.ts") == file_name.size() - 8))
|
||||||
|
{
|
||||||
|
std::string file = file_name;
|
||||||
|
printf("%s: delete %s\n", __func__, file.c_str());
|
||||||
|
unlink(file.c_str());
|
||||||
|
CMovieInfo mi;
|
||||||
|
if (mi.convertTs2XmlName(file))
|
||||||
|
{
|
||||||
|
printf("%s: delete %s\n", __func__, file.c_str());
|
||||||
|
unlink(file.c_str());
|
||||||
|
}
|
||||||
|
timeshift_deletion = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!filelist.empty() && filelist_it != filelist.end()) {
|
if (!filelist.empty() && filelist_it != filelist.end()) {
|
||||||
pretty_name.clear();
|
pretty_name.clear();
|
||||||
prepareFile(&(*filelist_it));
|
prepareFile(&(*filelist_it));
|
||||||
|
@@ -174,6 +174,7 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
std::string Path_local;
|
std::string Path_local;
|
||||||
int menu_ret;
|
int menu_ret;
|
||||||
bool autoshot_done;
|
bool autoshot_done;
|
||||||
|
bool timeshift_deletion;
|
||||||
//std::vector<livestream_info_t> liveStreamList;
|
//std::vector<livestream_info_t> liveStreamList;
|
||||||
|
|
||||||
/* playback from bookmark */
|
/* playback from bookmark */
|
||||||
@@ -248,6 +249,7 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
int getState() { return playstate; }
|
int getState() { return playstate; }
|
||||||
void UpdatePosition();
|
void UpdatePosition();
|
||||||
int timeshift;
|
int timeshift;
|
||||||
|
void deleteTimeshift() { timeshift_deletion = true; }
|
||||||
int file_prozent;
|
int file_prozent;
|
||||||
cPlayback *getPlayback() { return playback; }
|
cPlayback *getPlayback() { return playback; }
|
||||||
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; }
|
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; }
|
||||||
|
Reference in New Issue
Block a user