summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-02-12 00:06:13 +0100
committerCarl Hetherington <cth@carlh.net>2024-02-12 00:06:13 +0100
commit6f9adc9f7215a362d23e45b861017638ec67c723 (patch)
tree81c07fa6ddc8dca328c269bdfc8f2534c46ccd2c /src/lib
parenteade5cc8657f51d1d768b705936e918f8d1f53ee (diff)
parenteb04ac87ccfa046dd342ca7b9e6478c3bdcabbba (diff)
Merge branch 'main' into v2.17.x
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/analyse_audio_job.cc13
-rw-r--r--src/lib/analyse_audio_job.h3
-rw-r--r--src/lib/audio_analyser.cc10
-rw-r--r--src/lib/audio_analyser.h2
-rw-r--r--src/lib/dcp_examiner.cc3
-rw-r--r--src/lib/ecinema_kdm_data.h32
-rw-r--r--src/lib/player.cc12
-rw-r--r--src/lib/player.h2
-rw-r--r--src/lib/po/sl_SI.po68
-rw-r--r--src/lib/string_text_file.cc12
10 files changed, 66 insertions, 91 deletions
diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc
index ca0f49f57..a6ce5dcc8 100644
--- a/src/lib/analyse_audio_job.cc
+++ b/src/lib/analyse_audio_job.cc
@@ -47,12 +47,16 @@ using namespace boost::placeholders;
#endif
-/** @param from_zero true to analyse audio from time 0 in the playlist, otherwise begin at Playlist::start */
-AnalyseAudioJob::AnalyseAudioJob (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, bool from_zero)
+/** @param whole_film true to analyse the whole film' audio (i.e. start from time 0 and use processors), false
+ * to analyse just the single piece of content in the playlist (i.e. start from Playlist::start() and do not
+ * use processors.
+ */
+AnalyseAudioJob::AnalyseAudioJob (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, bool whole_film)
: Job (film)
- , _analyser (film, playlist, from_zero, boost::bind(&Job::set_progress, this, _1, false))
+ , _analyser(film, playlist, whole_film, boost::bind(&Job::set_progress, this, _1, false))
, _playlist (playlist)
, _path (film->audio_analysis_path(playlist))
+ , _whole_film(whole_film)
{
LOG_DEBUG_AUDIO_ANALYSIS_NC("AnalyseAudioJob::AnalyseAudioJob");
}
@@ -89,6 +93,9 @@ AnalyseAudioJob::run ()
player->set_fast ();
player->set_play_referenced ();
player->Audio.connect (bind(&AudioAnalyser::analyse, &_analyser, _1, _2));
+ if (!_whole_film) {
+ player->set_disable_audio_processor();
+ }
bool has_any_audio = false;
for (auto c: _playlist->content()) {
diff --git a/src/lib/analyse_audio_job.h b/src/lib/analyse_audio_job.h
index 2b749da6b..afd52c304 100644
--- a/src/lib/analyse_audio_job.h
+++ b/src/lib/analyse_audio_job.h
@@ -50,7 +50,7 @@ class Filter;
class AnalyseAudioJob : public Job
{
public:
- AnalyseAudioJob (std::shared_ptr<const Film>, std::shared_ptr<const Playlist>, bool from_zero);
+ AnalyseAudioJob(std::shared_ptr<const Film>, std::shared_ptr<const Playlist>, bool whole_film);
~AnalyseAudioJob ();
std::string name () const override;
@@ -70,6 +70,7 @@ private:
std::shared_ptr<const Playlist> _playlist;
/** playlist's audio analysis path when the job was created */
boost::filesystem::path _path;
+ bool _whole_film;
static const int _num_points;
};
diff --git a/src/lib/audio_analyser.cc b/src/lib/audio_analyser.cc
index df76932de..6e7b9fa86 100644
--- a/src/lib/audio_analyser.cc
+++ b/src/lib/audio_analyser.cc
@@ -52,7 +52,7 @@ using namespace dcpomatic;
static auto constexpr num_points = 1024;
-AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, bool from_zero, std::function<void (float)> set_progress)
+AudioAnalyser::AudioAnalyser(shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, bool whole_film, std::function<void (float)> set_progress)
: _film (film)
, _playlist (playlist)
, _set_progress (set_progress)
@@ -71,7 +71,7 @@ AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Play
_current = std::vector<AudioPoint>(_film->audio_channels());
- if (!from_zero) {
+ if (!whole_film) {
_start = _playlist->start().get_value_or(DCPTime());
}
@@ -87,7 +87,9 @@ AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Play
};
auto content = _playlist->content();
- if (content.size() == 1 && content[0]->audio) {
+ if (whole_film) {
+ _leqm_channels = film->audio_channels();
+ } else {
_leqm_channels = 0;
for (auto channel: content[0]->audio->mapping().mapped_output_channels()) {
/* This means that if, for example, a file only maps C we will
@@ -96,8 +98,6 @@ AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Play
*/
_leqm_channels = std::min(film->audio_channels(), channel + 1);
}
- } else {
- _leqm_channels = film->audio_channels();
}
/* XXX: is this right? Especially for more than 5.1? */
diff --git a/src/lib/audio_analyser.h b/src/lib/audio_analyser.h
index 4708f517a..3d40f8026 100644
--- a/src/lib/audio_analyser.h
+++ b/src/lib/audio_analyser.h
@@ -39,7 +39,7 @@ class Playlist;
class AudioAnalyser
{
public:
- AudioAnalyser (std::shared_ptr<const Film> film, std::shared_ptr<const Playlist> playlist, bool from_zero, std::function<void (float)> set_progress);
+ AudioAnalyser(std::shared_ptr<const Film> film, std::shared_ptr<const Playlist> playlist, bool whole_film, std::function<void (float)> set_progress);
AudioAnalyser (AudioAnalyser const&) = delete;
AudioAnalyser& operator= (AudioAnalyser const&) = delete;
diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc
index d9c904720..72eb82860 100644
--- a/src/lib/dcp_examiner.cc
+++ b/src/lib/dcp_examiner.cc
@@ -237,9 +237,6 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
for (auto const& font: asset->font_data()) {
_fonts.push_back({reel_index, asset->id(), make_shared<dcpomatic::Font>(font.first, font.second)});
}
- if (asset->font_data().empty()) {
- _fonts.push_back({reel_index, asset->id(), make_shared<dcpomatic::Font>("")});
- }
}
}
diff --git a/src/lib/ecinema_kdm_data.h b/src/lib/ecinema_kdm_data.h
deleted file mode 100644
index 9ca3b24d0..000000000
--- a/src/lib/ecinema_kdm_data.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- DCP-o-matic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-/* ECinema KDM data block contains:
- - key (16 bytes)
- - (optional) not-valid-before time (25 bytes)
- - (optional) not-valid-after time (25 bytes)
-*/
-
-#define ECINEMA_KDM_KEY 0
-#define ECINEMA_KDM_KEY_LENGTH 16
-#define ECINEMA_KDM_NOT_VALID_BEFORE (ECINEMA_KDM_KEY_LENGTH)
-#define ECINEMA_KDM_NOT_VALID_BEFORE_LENGTH 25
-#define ECINEMA_KDM_NOT_VALID_AFTER (ECINEMA_KDM_NOT_VALID_BEFORE + ECINEMA_KDM_NOT_VALID_BEFORE_LENGTH)
-#define ECINEMA_KDM_NOT_VALID_AFTER_LENGTH 25
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 888c56aec..3402cc12b 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -189,6 +189,7 @@ Player::Player(Player&& other)
, _silent(std::move(other._silent))
, _active_texts(std::move(other._active_texts))
, _audio_processor(std::move(other._audio_processor))
+ , _disable_audio_processor(other._disable_audio_processor)
, _playback_length(other._playback_length.load())
, _subtitle_alignment(other._subtitle_alignment)
{
@@ -228,6 +229,7 @@ Player::operator=(Player&& other)
_silent = std::move(other._silent);
_active_texts = std::move(other._active_texts);
_audio_processor = std::move(other._audio_processor);
+ _disable_audio_processor = other._disable_audio_processor;
_playback_length = other._playback_length.load();
_subtitle_alignment = other._subtitle_alignment;
@@ -1191,7 +1193,7 @@ Player::audio (weak_ptr<Piece> weak_piece, AudioStreamPtr stream, ContentAudio c
/* Process */
- if (_audio_processor) {
+ if (_audio_processor && !_disable_audio_processor) {
content_audio.audio = _audio_processor->run(content_audio.audio, film->audio_channels());
}
@@ -1589,3 +1591,11 @@ Player::signal_change(ChangeType type, int property)
Change(type, property, false);
}
+
+/** Must be called from the same thread that calls ::pass() */
+void
+Player::set_disable_audio_processor()
+{
+ _disable_audio_processor = true;
+}
+
diff --git a/src/lib/player.h b/src/lib/player.h
index d4fae9fc4..2502ae536 100644
--- a/src/lib/player.h
+++ b/src/lib/player.h
@@ -105,6 +105,7 @@ public:
void set_fast ();
void set_play_referenced ();
void set_dcp_decode_reduction (boost::optional<int> reduction);
+ void set_disable_audio_processor();
boost::optional<dcpomatic::DCPTime> content_time_to_dcp (std::shared_ptr<const Content> content, dcpomatic::ContentTime t) const;
boost::optional<dcpomatic::ContentTime> dcp_to_content_time (std::shared_ptr<const Content> content, dcpomatic::DCPTime t) const;
@@ -242,6 +243,7 @@ private:
EnumIndexedVector<ActiveText, TextType> _active_texts;
std::shared_ptr<AudioProcessor> _audio_processor;
+ bool _disable_audio_processor = false;
boost::atomic<dcpomatic::DCPTime> _playback_length;
diff --git a/src/lib/po/sl_SI.po b/src/lib/po/sl_SI.po
index 7a1cec1ca..82888f76b 100644
--- a/src/lib/po/sl_SI.po
+++ b/src/lib/po/sl_SI.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-12 00:54+0100\n"
-"PO-Revision-Date: 2023-09-14 22:18+0200\n"
+"PO-Revision-Date: 2024-02-10 16:15+0100\n"
"Last-Translator: Martin Srebotnjak <miles@filmsi.net>\n"
"Language-Team: \n"
"Language: sl_SI\n"
@@ -208,17 +208,17 @@ msgstr "; %1 preostalo; zaključevanje ob %2%3"
#: src/lib/analytics.cc:65
msgid ""
-"<h2>You have made %1 DCPs with DCP-o-matic!</h2><img width=\"20%%\" "
-"src=\"memory:me.jpg\" align=\"center\"><p>Hello. I'm Carl and I'm the "
-"developer of DCP-o-matic. I work on it in my spare time (with the help of a "
-"fine volunteer team of testers and translators) and I release it as free "
-"software.<p>If you find DCP-o-matic useful, please consider a donation to "
-"the project. Financial support will help me to spend more time developing "
-"DCP-o-matic and making it better!<p><ul><li><a href=\"https://dcpomatic.com/"
-"donate_amount?amount=40\">Go to Paypal to donate €40</a><li><a "
-"href=\"https://dcpomatic.com/donate_amount?amount=20\">Go to Paypal to "
-"donate €20</a><li><a href=\"https://dcpomatic.com/donate_amount?"
-"amount=10\">Go to Paypal to donate €10</a></ul><p>Thank you!"
+"<h2>You have made %1 DCPs with DCP-o-matic!</h2><img width=\"20%%\" src="
+"\"memory:me.jpg\" align=\"center\"><p>Hello. I'm Carl and I'm the developer "
+"of DCP-o-matic. I work on it in my spare time (with the help of a fine "
+"volunteer team of testers and translators) and I release it as free software."
+"<p>If you find DCP-o-matic useful, please consider a donation to the "
+"project. Financial support will help me to spend more time developing DCP-o-"
+"matic and making it better!<p><ul><li><a href=\"https://dcpomatic.com/"
+"donate_amount?amount=40\">Go to Paypal to donate €40</a><li><a href="
+"\"https://dcpomatic.com/donate_amount?amount=20\">Go to Paypal to donate "
+"€20</a><li><a href=\"https://dcpomatic.com/donate_amount?amount=10\">Go to "
+"Paypal to donate €10</a></ul><p>Thank you!"
msgstr ""
"<h2>%1 DCP ste izdelali z DCP-o-matic!</h2><img width=\"20%%\" src=\"memory:"
"me.jpg\" align=\"center\"><p>Pozdravljeni. Jaz sem Carl in sem razvijalec "
@@ -929,9 +929,8 @@ msgid "Event"
msgstr "Dogodek"
#: src/lib/hints.cc:397
-#, fuzzy
msgid "Examining audio"
-msgstr "Preučevanje podnaslovov"
+msgstr "Preučevanje zvoka"
#: src/lib/hints.cc:399
msgid "Examining audio, subtitles and closed captions"
@@ -1078,7 +1077,6 @@ msgid "If you do use 25fps you should change your DCP standard to SMPTE."
msgstr "Če uporabljate 25 sl/s, morate spremeniti standard DCP v SMPTE."
#: src/lib/hints.cc:249
-#, fuzzy
msgid ""
"In general it is now advisable to make SMPTE DCPs unless you have a "
"particular reason to use Interop. It is advisable to set your DCP to use "
@@ -1086,7 +1084,7 @@ msgid ""
msgstr ""
"Na splošno je zdaj priporočljivo, da izdelujete DCP-je SMPTE, razen če imate "
"poseben razlog za uporabo Interop. Svetujemo, da vaš DCP uporablja standard "
-"SMPTE, ki ga določite na zavihku »DCP«."
+"SMPTE, kar določite na zavihku »DCP«."
#: src/lib/release_notes.cc:53
msgid ""
@@ -1231,14 +1229,13 @@ msgid "No CPLs found in DCP."
msgstr "V DCP-ju ni CPL-jev."
#: src/lib/kdm_with_metadata.cc:217
-#, fuzzy
msgid "No from address configured in the KDM Email tab of preferences"
-msgstr "Noben KDM iz naslova ni določen v nastavitvah"
+msgstr "Noben dohodni naslov ni določen v nastavitvah na zavihku e-naslova KDM"
#: src/lib/kdm_with_metadata.cc:213 src/lib/send_notification_email_job.cc:70
-#, fuzzy
msgid "No outgoing mail server configured in the Email tab of preferences"
-msgstr "Noben poštni strežnik ni določen v nastavitvah"
+msgstr ""
+"Noben odhodni poštni strežnik ni določen v nastavitvah na zavihku e-pošte"
#: src/lib/image_content.cc:131
msgid "No valid image files were found in the folder."
@@ -1309,7 +1306,7 @@ msgstr "Politika"
#: src/lib/filter.cc:106
msgid "Premultiply alpha channel"
-msgstr ""
+msgstr "Vnaprej pomnoži kanal alfa"
#: src/lib/content.cc:494
msgid "Prepared for video frame rate"
@@ -1578,7 +1575,6 @@ msgid "The certificate chain for signing is invalid (%1)"
msgstr "Veriga potrdil za podpisovanje ni veljavna (%1)"
#: src/lib/hints.cc:721
-#, fuzzy
msgid ""
"The certificate chain that DCP-o-matic uses for signing DCPs and KDMs "
"contains a small error which will prevent DCPs from being validated "
@@ -1586,14 +1582,13 @@ msgid ""
"certificate chain by clicking the \"Re-make certificates and key...\" button "
"in the Keys page of Preferences."
msgstr ""
-"Veriga potrdil, ki jo DCP-o-matic uporablja za podpisovanje DCP in KDM-jev, "
-"vsebuje majhno napako, ki bo preprečila pravilno preverjanje veljavnosti DCP "
-"v nekaterih sistemih. Svetujemo vam, da znova ustvarite verigo potrdil za "
-"podpisovanje s klikom gumba »Ponovno izdelaj potrdila in ključ …« na strani "
-"Ključi v Nastavitvah."
+"Veriga potrdil, ki jo DCP-o-matic uporablja za podpisovanje DCP-jev in KDM-"
+"jev, vsebuje majhno napako, ki bo preprečila pravilno preverjanje "
+"veljavnosti DCP v nekaterih sistemih. Svetujemo vam, da znova ustvarite "
+"verigo potrdil za podpisovanje s klikom gumba »Ponovno izdelaj potrdila in "
+"ključ …« na strani Ključi v Nastavitvah."
#: src/lib/hints.cc:727
-#, fuzzy
msgid ""
"The certificate chain that DCP-o-matic uses for signing DCPs and KDMs has a "
"validity period that is too long. This will cause problems playing back "
@@ -1642,7 +1637,6 @@ msgid "The file %1 has been trimmed by %2 milliseconds more."
msgstr "Datoteka %1 je bila obrezana za %2 milisekund več."
#: src/lib/hints.cc:239
-#, fuzzy
msgid ""
"There is a large difference between the frame rate of your DCP and that of "
"some of your content. This will cause your audio to play back at a much "
@@ -1651,7 +1645,7 @@ msgid ""
"systems support your chosen DCP rate."
msgstr ""
"Velika razlika je med hitrostjo sličic vašega DCP-ja in nekaterih vaših "
-"vsebin. To bo povzročilo predvajanje zvoka na precej nižjem ali višjem "
+"vsebin. To bo povzročilo predvajanje zvoka pri precej nižji ali višji "
"frekvenci, kot bi bilo potrebno. Svetujemo vam, da nastavite hitrost sličic "
"DCP na takšno, ki je bližje vaši vsebini, pod pogojem, da ciljni sistemi "
"projekcije podpirajo izbrano hitrost DCP."
@@ -1840,15 +1834,14 @@ msgid "Yet Another Deinterlacing Filter"
msgstr "Še en filter za razpletanje"
#: src/lib/hints.cc:199
-#, fuzzy
msgid ""
"You are set up for a DCP at a frame rate of %1 fps. This frame rate is not "
"supported by all projectors. It is advisable to change the DCP frame rate "
"to %2 fps."
msgstr ""
"Nastavljeno imate za DCP s hitrostjo %1 sl/s. Te hitrosti sličic ne "
-"podpirajo vsi projektorji. Svetujemo vam, da spremenite hitrost sličic DCP "
-"na %2 sl/s."
+"podpirajo vsi projektorji. Svetujemo vam, da spremenite hitrost predvajanja "
+"DCP na %2 sl/s."
#: src/lib/hints.cc:183
msgid ""
@@ -2181,12 +2174,3 @@ msgstr "neznano"
#: src/lib/video_content.cc:516
msgid "video frames"
msgstr "video sličice"
-
-#~ msgid "it does not have closed captions in all its reels."
-#~ msgstr "nima zaprtih napisov v vseh svojih kolutih."
-
-#~ msgid "it does not have open subtitles in all its reels."
-#~ msgstr "nima odprtih podnaslovov v vseh svojih kolutih."
-
-#~ msgid "it does not have sound in all its reels."
-#~ msgstr "nima zvoka v vseh svojih kolutih."
diff --git a/src/lib/string_text_file.cc b/src/lib/string_text_file.cc
index 348ccd1d5..9b43b35a6 100644
--- a/src/lib/string_text_file.cc
+++ b/src/lib/string_text_file.cc
@@ -25,6 +25,7 @@
#include "string_text_file_content.h"
#include <dcp/file.h>
#include <sub/collect.h>
+#include <sub/exceptions.h>
#include <sub/ssa_reader.h>
#include <sub/stl_binary_reader.h>
#include <sub/subrip_reader.h>
@@ -105,9 +106,14 @@ StringTextFile::StringTextFile (shared_ptr<const StringTextFileContent> content)
if (ext == ".srt") {
try {
reader.reset(new sub::SubripReader(utf8.get()));
- } catch (...) {
- /* Sometimes files are have the .srt extension but are really WEBVTT */
- reader.reset(new sub::WebVTTReader(utf8.get()));
+ } catch (sub::SubripError& subrip_error) {
+ /* Sometimes files are have the .srt extension but are really WEBVTT... */
+ try {
+ reader.reset(new sub::WebVTTReader(utf8.get()));
+ } catch (sub::WebVTTHeaderError&) {
+ /* ...but in this case there isn't even a WebVTT error */
+ throw subrip_error;
+ }
}
} else if (ext == ".ssa" || ext == ".ass") {
reader.reset(new sub::SSAReader(utf8.get()));