From 84da8e8902a8e79886488dbfa3e62c0ea3a40f34 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 18 Mar 2019 18:37:10 +0100 Subject: [PATCH] use strftime instead of std::put_time, for sh4 build Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5c247c0d1b5fca5857dba2c2538bca3d61a625d2 Author: Jacek Jendrzej Date: 2019-03-18 (Mon, 18 Mar 2019) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index a6b46f651..89e6df7a3 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -80,8 +80,6 @@ #include #include #include -#include -#include //NI InfoIcons #include @@ -3256,11 +3254,13 @@ void CMoviePlayerGui::makeScreenShot(bool autoshot, bool forcover) cover = false; autoshot = false; forcover = false; - std::time_t t = std::time(NULL); - std::tm tm = *std::localtime(&t); - std::stringstream ss; - ss << std::put_time(&tm, "%Y%m%d_%H%M%S"); - tmp_str = ss.str(); + struct timeval tv; + gettimeofday(&tv, NULL); + char buf_time[128]; + strftime(buf_time, sizeof(buf_time) , "_%Y%m%d_%H%M%S", localtime(&tv.tv_sec)); + size_t pos = strlen(buf_time); + snprintf(&(buf_time[pos]), sizeof(buf_time) - pos - 1, "_%03d", (int) tv.tv_usec/1000); + tmp_str = buf_time; } tmp_str += ending; std::string::size_type pos = fname.find_last_of('.');