diff --git a/src/Frame.h b/src/Frame.h index 721c7b3f96..19a86590bf 100644 --- a/src/Frame.h +++ b/src/Frame.h @@ -62,7 +62,9 @@ class Frame { return *this; } - explicit operator bool() const { return m_data; } + explicit operator bool() const { + return m_data && m_data->pixelFormat != VideoMode::kUnknown; + } operator llvm::StringRef() const { if (!m_data) return llvm::StringRef{}; diff --git a/src/SourceImpl.h b/src/SourceImpl.h index 166f5beb66..5fff01d434 100644 --- a/src/SourceImpl.h +++ b/src/SourceImpl.h @@ -118,6 +118,9 @@ class SourceImpl { protected: void PutFrame(VideoMode::PixelFormat pixelFormat, llvm::StringRef data, Frame::Time time); + void PutError(llvm::StringRef msg, Frame::Time time) { + PutFrame(VideoMode::kUnknown, msg, time); + } // Notification functions for corresponding atomics virtual void NumSinksChanged() = 0;