diff --git a/SDK/C/src/streams.cpp b/SDK/C/src/streams.cpp index e9dc6ff0791491889619d3eb113201a10d0343fd..ea112ad5caed1cdd75ab67277197a9b2ef65562c 100644 --- a/SDK/C/src/streams.cpp +++ b/SDK/C/src/streams.cpp @@ -59,6 +59,7 @@ ftlStream_t ftlCreateWriteStream(const char *uri) { s->interval = 40; s->video_fs.frames.reserve(32); s->video_states.resize(32); + s->has_fresh_data = false; switch (u.getScheme()) { case ftl::URI::SCHEME_FILE : createFileWriteStream(s, u); break; diff --git a/components/common/cpp/src/uri.cpp b/components/common/cpp/src/uri.cpp index 39ddb47e107a8a9a8dd499d9d4ab7e7e9ec1ae26..6884720d1e17cd5a222b56699ce754892ef9cd59 100644 --- a/components/common/cpp/src/uri.cpp +++ b/components/common/cpp/src/uri.cpp @@ -45,6 +45,8 @@ void URI::_parse(uri_t puri) { if (getcwd(cwdbuf, 1024)) { suri = string("file://") + string(cwdbuf) + suri.substr(1); } + } else if (suri[0] == '/') { + suri = std::string("file://") + suri; } else if (suri[0] == '~') { #ifdef WIN32 suri = string("file://") + string(std::getenv("HOMEDRIVE")) + string(std::getenv("HOMEPATH")) + suri.substr(1); diff --git a/components/streams/src/filestream.cpp b/components/streams/src/filestream.cpp index 412594814c597babbdb09266358b370dc8e71a6b..b25c0248e266544b0b7d76af1618756d492e10b4 100644 --- a/components/streams/src/filestream.cpp +++ b/components/streams/src/filestream.cpp @@ -91,7 +91,7 @@ bool File::post(const ftl::codecs::StreamPacket &s, const ftl::codecs::Packet &p return false; } - LOG(INFO) << "WRITE: " << s.timestamp << " " << (int)s.channel << " " << p.data.size(); + //LOG(INFO) << "WRITE: " << s.timestamp << " " << (int)s.channel << " " << p.data.size(); // Don't write dummy packets to files. if (p.data.size() == 0) return true; @@ -319,7 +319,7 @@ bool File::begin(bool dorun) { ostream_->open(*get<std::string>("filename"), std::ifstream::out | std::ifstream::binary); if (!ostream_->good()) { - LOG(ERROR) << "Could not open file: " << *get<std::string>("filename"); + LOG(ERROR) << "Could not open file: '" << *get<std::string>("filename") << "'"; return false; }