+2013-04-20 Carl Hetherington <cth@carlh.net>
+
+ * Fix bad saving of metadata in locales which use
+ commas to separate decimals (#119).
+
2013-04-19 Carl Hetherington <cth@carlh.net>
* Add basic frame index and timecode to viewer, and previous/next
Film::video_state_identifier () const
{
assert (format ());
+ LocaleGuard lg;
pair<string, string> f = Filter::ffmpeg_strings (filters());
Film::write_metadata () const
{
boost::mutex::scoped_lock lm (_state_mutex);
+ LocaleGuard lg;
boost::filesystem::create_directories (directory());
Film::read_metadata ()
{
boost::mutex::scoped_lock lm (_state_mutex);
+ LocaleGuard lg;
_external_audio.clear ();
_content_audio_streams.clear ();
}
}
}
+
+LocaleGuard::LocaleGuard ()
+ : _old (0)
+{
+ char const * old = setlocale (LC_NUMERIC, 0);
+
+ if (old) {
+ _old = strdup (old);
+ if (strcmp (_old, "POSIX")) {
+ setlocale (LC_NUMERIC, "POSIX");
+ }
+ }
+}
+
+LocaleGuard::~LocaleGuard ()
+{
+ setlocale (LC_NUMERIC, _old);
+ free (_old);
+}
extern bool still_image_file (std::string);
extern std::pair<std::string, int> cpu_info ();
+class LocaleGuard
+{
+public:
+ LocaleGuard ();
+ ~LocaleGuard ();
+
+private:
+ char* _old;
+};
+
+
#endif