Skip to content

Commit

Permalink
packet can be const
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Apr 20, 2021
1 parent 320dfff commit b0b95b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/zm_fifo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ bool Fifo::close() {
return true;
}

bool Fifo::writePacket(ZMPacket &packet) {
bool Fifo::writePacket(const ZMPacket &packet) {
if (!(outfile or open())) return false;

Debug(2, "Writing header ZM %u %" PRId64, packet.packet.size, packet.pts);
Expand All @@ -123,7 +123,7 @@ bool Fifo::writePacket(ZMPacket &packet) {
return true;
}

bool Fifo::writePacket(std::string filename, ZMPacket &packet) {
bool Fifo::writePacket(std::string filename, const ZMPacket &packet) {
FILE *outfile = nullptr;

int raw_fd = ::open(filename.c_str(), O_WRONLY|O_NONBLOCK|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
Expand Down
4 changes: 2 additions & 2 deletions src/zm_fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ class Fifo {



static bool writePacket(std::string filename, ZMPacket &packet);
static bool writePacket(std::string filename, const ZMPacket &packet);
static bool write(std::string filename, uint8_t *data, size_t size);

bool open();
bool close();

bool writePacket(ZMPacket &packet);
bool writePacket(const ZMPacket &packet);
bool write(uint8_t *data, size_t size, int64_t pts);
};
#endif // ZM_FIFO_H

0 comments on commit b0b95b5

Please sign in to comment.