Merge tag 'v2.16.76' into v2.17.x
authorCarl Hetherington <cth@carlh.net>
Sun, 18 Feb 2024 23:56:14 +0000 (00:56 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 18 Feb 2024 23:56:14 +0000 (00:56 +0100)
1  2 
cscript
src/lib/dcp_content.cc
src/lib/dcp_decoder.cc

diff --combined cscript
index 4bc3e5674ea8e35a686c7000777c236aefb650c9,8c6c126dba6c0d56e83f080176eb83f3c2d2d512..e3a3f26e23bc3f564266224791ab34f6f1c4db7e
+++ b/cscript
@@@ -502,12 -502,12 +502,12 @@@ def dependencies(target, options)
          ffmpeg_options = {}
  
      if target.platform != 'linux' or target.distro != 'arch':
 -        deps = [('ffmpeg', '7276e269a93c2ae30e302c34708e8095ac5475e8', ffmpeg_options)]
 +        deps = [('ffmpeg', '0b73d2f5e70a04a67aa902902c42e3025ef3bb77', ffmpeg_options)]
      else:
          # Use distro-provided FFmpeg on Arch
          deps = []
  
-     deps.append(('libdcp', 'v1.8.95'))
+     deps.append(('libdcp', 'v1.8.96'))
      deps.append(('libsub', 'v1.6.47'))
      deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23'))
      deps.append(('rtaudio', 'f619b76'))
      deps.append(('openssl', '54298369cacfe0ae01c5aa42ace8a463fd2e7a2e'))
      if can_build_disk(target):
          deps.append(('lwext4', 'ab082923a791b58478d1d9939d65a0583566ac1f'))
 -    deps.append(('ffcmp', '53c853d2935de3f2b0d53777529e48c102afd237'))
 +    deps.append(('ffcmp', '5ab6ed3b75d8ca7cf1f66bb9fb08792b92f4b419'))
  
      return deps
  
@@@ -563,9 -563,6 +563,9 @@@ def configure_options(target, options, 
      if target.platform == 'osx' and target.arch == 'arm64':
          opt += ' --target-macos-arm64 --wx-config=%s/wx-config' % target.bin
  
 +    if target.platform == 'linux' and target.distro == 'ubuntu' and target.version in ['22.04']:
 +        opt += ' --enable-grok'
 +
      return opt
  
  def build(target, options, for_package):
diff --combined src/lib/dcp_content.cc
index d92c64ce012d53d0a4572aa94c6ddd91c14a9f88,e22f69f56c62b8373b58e60dc04fb8d81d311a12..4d1ab4f8805949fe2c5f85fc48d0872f002fa03d
@@@ -612,7 -612,7 +612,7 @@@ DCPContent::reel_split_points (shared_p
  }
  
  bool
 -DCPContent::can_reference (shared_ptr<const Film> film, function<bool (shared_ptr<const Content>)> part, string overlapping, string& why_not) const
 +DCPContent::can_reference_anything(shared_ptr<const Film> film, string& why_not) const
  {
        /* We must be using the same standard as the film */
        if (_standard) {
                }
        }
  
 -      auto a = overlaps (film, film->content(), part, position(), end(film));
 -      if (a.size() != 1 || a.front().get() != this) {
 -              why_not = overlapping;
 -              return false;
 -      }
 -
        return true;
  }
  
 +bool
 +DCPContent::overlaps(shared_ptr<const Film> film, function<bool (shared_ptr<const Content>)> part) const
 +{
 +      auto const a = dcpomatic::overlaps(film, film->content(), part, position(), end(film));
 +      return a.size() != 1 || a.front().get() != this;
 +}
 +
  
  bool
  DCPContent::can_reference_video (shared_ptr<const Film> film, string& why_not) const
                return false;
        }
  
 -      /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
 -      return can_reference(
 -              film,
 -              [](shared_ptr<const Content> c) {
 -                      return static_cast<bool>(c->video) && c->video->use();
 -              },
 -              _("it overlaps other video content; remove the other content."),
 -              why_not
 -      );
 +      auto part = [](shared_ptr<const Content> c) {
 +              return static_cast<bool>(c->video) && c->video->use();
 +      };
 +
 +      if (overlaps(film, part)) {
 +              /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
 +              why_not = _("it overlaps other video content; remove the other content.");
 +              return false;
 +      }
 +
 +      return can_reference_anything(film, why_not);
  }
  
  
@@@ -723,17 -720,14 +723,17 @@@ DCPContent::can_reference_audio (shared
                return false;
        }
  
 -      /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
 -      return can_reference(
 -              film, [](shared_ptr<const Content> c) {
 -                      return static_cast<bool>(c->audio) && !c->audio->mapping().mapped_output_channels().empty();
 -              },
 -              _("it overlaps other audio content; remove the other content."),
 -              why_not
 -      );
 +      auto part = [](shared_ptr<const Content> c) {
 +              return static_cast<bool>(c->audio) && !c->audio->mapping().mapped_output_channels().empty();
 +      };
 +
 +      if (overlaps(film, part)) {
 +              /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
 +              why_not = _("it overlaps other audio content; remove the other content.");
 +              return false;
 +      }
 +
 +      return can_reference_anything(film, why_not);
  }
  
  
@@@ -746,6 -740,9 +746,9 @@@ DCPContent::can_reference_text (shared_
        } catch (dcp::ReadError &) {
                /* We couldn't read the DCP, so it's probably missing */
                return false;
+       } catch (DCPError &) {
+               /* We couldn't read the DCP, so it's probably missing */
+               return false;
        } catch (dcp::KDMDecryptionError &) {
                /* We have an incorrect KDM */
                return false;
                return false;
        }
  
 -      /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
 -      return can_reference(
 -              film,
 -              [type](shared_ptr<const Content> c) {
 -                      return std::find_if(c->text.begin(), c->text.end(), [type](shared_ptr<const TextContent> t) { return t->type() == type; }) != c->text.end();
 -              },
 -              _("they overlap other text content; remove the other content."),
 -              why_not
 -      );
 +      auto part = [type](shared_ptr<const Content> c) {
 +              return std::find_if(c->text.begin(), c->text.end(), [type](shared_ptr<const TextContent> t) { return t->type() == type; }) != c->text.end();
 +      };
 +
 +      if (overlaps(film, part)) {
 +              /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
 +              why_not = _("it overlaps other text content; remove the other content.");
 +              return false;
 +      }
 +
 +      return can_reference_anything(film, why_not);
  }
  
  void
diff --combined src/lib/dcp_decoder.cc
index cf8521d48f6f90b9a3f144614554a221e07853b6,165b5bfb55a2b3ee70521f55fd3a15815722cc65..303126caa840292ab894bd6455e194d4c50193d2
@@@ -105,7 -105,6 +105,6 @@@ DCPDecoder::DCPDecoder (shared_ptr<cons
        if (old && old->lazy_digest() == _lazy_digest) {
                _reels = old->_reels;
        } else {
                auto cpl_list = dcp::find_and_resolve_cpls(content->directories(), tolerant);
  
                if (cpl_list.empty()) {
@@@ -181,7 -180,7 +180,7 @@@ DCPDecoder::pass (
                                        AV_PIX_FMT_XYZ12LE,
                                        _forced_reduction
                                        ),
 -                              _offset + frame
 +                              ContentTime::from_frames(_offset + frame, vfr)
                                );
                } else {
                        video->emit (
                                        AV_PIX_FMT_XYZ12LE,
                                        _forced_reduction
                                        ),
 -                              _offset + frame
 +                              ContentTime::from_frames(_offset + frame, vfr)
                                );
  
                        video->emit (
                                        AV_PIX_FMT_XYZ12LE,
                                        _forced_reduction
                                        ),
 -                              _offset + frame
 +                              ContentTime::from_frames(_offset + frame, vfr)
                                );
                }
        }