summaryrefslogtreecommitdiff
path: root/src/cam/buffer_writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cam/buffer_writer.cpp')
-rw-r--r--src/cam/buffer_writer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cam/buffer_writer.cpp b/src/cam/buffer_writer.cpp
index f2b21aef..a7648a92 100644
--- a/src/cam/buffer_writer.cpp
+++ b/src/cam/buffer_writer.cpp
@@ -49,7 +49,12 @@ int BufferWriter::write(FrameBuffer *buffer, const std::string &streamName)
size_t pos;
int fd, ret = 0;
- filename = pattern_;
+ if (!pattern_.empty())
+ filename = pattern_;
+
+ if (filename.empty() || filename.back() == '/')
+ filename += "frame-#.bin";
+
pos = filename.find_first_of('#');
if (pos != std::string::npos) {
std::stringstream ss;