From afd18ea6b14373b2078b6d6dbc74c836e6843757 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 17 May 2024 15:02:57 +0200 Subject: Make sure we don't say some content has audio if none will be emitted. In the FFmpeg (and shortly DCP) case we don't emit any audio if none is mapped, so we must take this into account in the player. --- src/lib/player.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/player.cc b/src/lib/player.cc index 91a51c67f..27c89a2fa 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -251,7 +251,7 @@ have_video (shared_ptr content) bool have_audio (shared_ptr content) { - return static_cast(content->audio) && content->can_be_played(); + return static_cast(content->audio) && !content->audio->mapping().mapped_output_channels().empty() && content->can_be_played(); } -- cgit v1.2.3 From 7f6cc5c6e151c32fce94181689cf740a011feafb Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 17 May 2024 15:03:15 +0200 Subject: Emit no audio from DCPs if none is mapped This makes DCP content behave the same as FFmpeg. --- src/lib/dcp_decoder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 165b5bfb5..17f0e73b5 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -77,7 +77,7 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptrvideo) { video = make_shared(this, content); } - if (content->audio) { + if (content->audio && !content->audio->mapping().mapped_output_channels().empty()) { audio = make_shared(this, content->audio, fast); } for (auto i: content->text) { -- cgit v1.2.3