@@ -265,11 +265,21 @@ int CameraSession::start()
#endif
#ifdef HAVE_SDL
- if (options_.isSet(OptSDL))
+ if (options_.isSet(OptSDL)) {
+ if (defaultSink) {
+ std::cerr << "Multiple default sinks not allowed" << std::endl;
+ return -EINVAL;
+ }
defaultSink = std::make_unique<SDLSink>();
+ }
#endif
if (options_.isSet(OptFile)) {
+ if (defaultSink) {
+ std::cerr << "Multiple default sinks not allowed" << std::endl;
+ return -EINVAL;
+ }
+
std::unique_ptr<FileSink> sink =
std::make_unique<FileSink>(camera_.get(), streamNames_);
Multiple default sinks are not really supported, if more than one sink is present then the last one wins and the other ones are just created but not used actually. Let's check for this and report an error in such a case. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> --- src/apps/cam/camera_session.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)