From 9a0e1eb08bee98703ee92b8fc90600c08b19ea4e Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 30 Jan 2011 16:33:40 +0000 Subject: [PATCH] neutrino: exit movieplayer 10 seconds after EOF git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1098 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/75a644347bca1a8373e959546c8d7736e7e506d4 Author: Stefan Seyfried Date: 2011-01-30 (Sun, 30 Jan 2011) --- src/gui/movieplayer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 1cb408995..b4b9363ce 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -444,6 +444,7 @@ void CMoviePlayerGui::PlayFile(void) timeb current_time; CMovieInfo cMovieInfo; // funktions to save and load movie info MI_MOVIE_INFO *p_movie_info = NULL; // movie info handle which comes from the MovieBrowser, if not NULL MoviePla yer is able to save new bookmarks + int eof = 0; if (has_hdd) system("(rm /hdd/.wakeup; touch /hdd/.wakeup; sync) > /dev/null 2> /dev/null &"); @@ -914,6 +915,14 @@ void CMoviePlayerGui::PlayFile(void) file_prozent = (unsigned char) (position / (duration / 100)); playback->GetSpeed(speed); printf("CMoviePlayerGui::PlayFile: speed %d position %d duration %d (%d, %d%%)\n", speed, position, duration, duration-position, file_prozent); + if (duration - position < 1000 && !timeshift) + { + /* 10 seconds after end-of-file, exit */ + if (++eof > 10) + g_RCInput->postMsg((neutrino_msg_t) g_settings.mpkey_stop, 0); + } + else + eof = 0; } }