diff --git a/components/codecs/include/ftl/codecs/packet.hpp b/components/codecs/include/ftl/codecs/packet.hpp index 988617fc5dd893c1f91a168a185d81cc7f4d341d..edddd205a728e66943e6362b0d24b865272de48e 100644 --- a/components/codecs/include/ftl/codecs/packet.hpp +++ b/components/codecs/include/ftl/codecs/packet.hpp @@ -43,7 +43,7 @@ struct Packet { */ struct StreamPacket { int64_t timestamp; - uint8_t streamID; // Source number... + uint8_t streamID; // Source number... 255 = broadcast stream uint8_t channel_count; // Number of channels to expect for this frame to complete (usually 1 or 2) ftl::codecs::Channel channel; // Actual channel of this current set of packets diff --git a/components/codecs/include/ftl/codecs/reader.hpp b/components/codecs/include/ftl/codecs/reader.hpp index 65be39eaa31f31f485883378ed9b782418d1fbc7..9e607c77f25c501ef04f64dc11a749ee528c4381 100644 --- a/components/codecs/include/ftl/codecs/reader.hpp +++ b/components/codecs/include/ftl/codecs/reader.hpp @@ -14,7 +14,7 @@ namespace codecs { class Reader { public: - Reader(std::istream &); + explicit Reader(std::istream &); ~Reader(); /** diff --git a/components/codecs/include/ftl/codecs/writer.hpp b/components/codecs/include/ftl/codecs/writer.hpp index abdbdb3db6fafc8d1a65652b44941bb6ce1c44ab..3befecf7cdff226f4b91dba599b82a5e66c0217d 100644 --- a/components/codecs/include/ftl/codecs/writer.hpp +++ b/components/codecs/include/ftl/codecs/writer.hpp @@ -12,7 +12,7 @@ namespace codecs { class Writer { public: - Writer(std::ostream &); + explicit Writer(std::ostream &); ~Writer(); bool begin(); diff --git a/components/codecs/src/reader.cpp b/components/codecs/src/reader.cpp index 96002aeeea252413f7af641cf006836fcf79b384..c12c6c6dce50b3ac28b57cba76016216823bb12a 100644 --- a/components/codecs/src/reader.cpp +++ b/components/codecs/src/reader.cpp @@ -92,6 +92,11 @@ bool Reader::read(int64_t ts) { return read(ts, [this](const ftl::codecs::StreamPacket &spkt, ftl::codecs::Packet &pkt) { if (handlers_.size() > spkt.streamID && (bool)handlers_[spkt.streamID]) { handlers_[spkt.streamID](spkt, pkt); + } else if (spkt.streamID == 255) { + // Broadcast stream, send packets to every source handler. + for (auto &h : handlers_) { + h(spkt, pkt); + } } }); }