diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index c020f067f9..fc5248adb7 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit c020f067f96099ae4491edcdabaf65ef7808b595 +Subproject commit fc5248adb7e372d1cae7306b2fba5c1627af0179 diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index c9b295b497..2e480e936e 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -410,8 +410,13 @@ bool SessionRecording::startPlayback(std::string& filename, LERROR("Unknown data type in header (should be Ascii or Binary)"); cleanUpPlayback(); } - // throwaway newline character - readHeaderElement(_playbackFile, 1); + // throwaway newline character(s) + std::string lineEnd = readHeaderElement(_playbackFile, 1); + bool isDosLineEnding = (lineEnd == "\r"); + if (isDosLineEnding) { + // throwaway the second newline character (\n) also + readHeaderElement(_playbackFile, 1); + } if (_recordingDataMode == DataMode::Binary) { // Close & re-open the file, starting from the beginning, and do dummy read @@ -419,7 +424,8 @@ bool SessionRecording::startPlayback(std::string& filename, _playbackFile.close(); _playbackFile.open(_playbackFilename, std::ifstream::in | std::ios::binary); size_t headerSize = FileHeaderTitle.length() + FileHeaderVersionLength - + sizeof(DataFormatBinaryTag) + sizeof('\n'); + + sizeof(DataFormatBinaryTag) + sizeof('\n') + + ((isDosLineEnding) ? sizeof('\r') : 0); std::vector hBuffer; hBuffer.resize(headerSize); _playbackFile.read(hBuffer.data(), headerSize);