From 094e6dd40e74fcb9e8879402bc8c41b889b11500 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 24 Dec 2011 14:08:07 +0000 Subject: [PATCH] record:restore user bookmarks git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1997 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/driver/record.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index f9d29839a..94a1cf92d 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -202,7 +202,16 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel /*, APIDList & bool CRecordInstance::Stop(bool remove_event) { - char buf[FILENAMEBUFFERSIZE]; + char buf[FILENAMEBUFFERSIZE]={0}; + + struct stat test; + snprintf(buf,sizeof(buf), "%s.xml", filename); + if(stat(buf, &test) == 0){ + cMovieInfo->clearMovieInfo(recMovieInfo); + snprintf(buf,sizeof(buf), "%s.ts", filename); + recMovieInfo->file.Name = buf; + cMovieInfo->loadMovieInfo(recMovieInfo);//restore user bookmark + } time_t end_time = time(0); recMovieInfo->length = (int) round((double) (end_time - start_time) / (double) 60); @@ -217,9 +226,9 @@ bool CRecordInstance::Stop(bool remove_event) CCamManager::getInstance()->Stop(channel_id, CCamManager::RECORD); if((autoshift && g_settings.auto_delete) /* || autoshift_delete*/) { - sprintf(buf, "rm -f %s.ts &", filename); + snprintf(buf,sizeof(buf), "rm -f %s.ts &", filename); system(buf); - sprintf(buf, "%s.xml", filename); + snprintf(buf,sizeof(buf), "%s.xml", filename); //autoshift_delete = false; unlink(buf); }