summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-12-20 23:37:57 +0000
committerCarl Hetherington <cth@carlh.net>2014-12-20 23:37:57 +0000
commit4dbc6ef917aeceb906b1ef1caf6911033e7e2c54 (patch)
tree203675d00d5cc004be6205218f835b6d7a10e925 /src
parentab32f60c2c9f2ad01dc8d96dc375df256dba0c41 (diff)
Hand-apply d849d411cff28ef5453085791d0b4d7cd73bd070 from master; replace all assert()s with thrown exceptions.
Diffstat (limited to 'src')
-rw-r--r--src/lib/audio_analysis.cc7
-rw-r--r--src/lib/audio_buffers.cc49
-rw-r--r--src/lib/audio_content.cc6
-rw-r--r--src/lib/audio_decoder.cc2
-rw-r--r--src/lib/cinema_sound_processor.cc3
-rw-r--r--src/lib/content.cc2
-rw-r--r--src/lib/content_subtitle.cc2
-rw-r--r--src/lib/dcp_content.cc2
-rw-r--r--src/lib/dcp_content_type.cc3
-rw-r--r--src/lib/dcp_decoder.cc2
-rw-r--r--src/lib/dcp_video.h1
-rw-r--r--src/lib/dcpomatic_time.h5
-rw-r--r--src/lib/exceptions.cc6
-rw-r--r--src/lib/exceptions.h6
-rw-r--r--src/lib/ffmpeg_content.cc6
-rw-r--r--src/lib/ffmpeg_decoder.cc6
-rw-r--r--src/lib/ffmpeg_stream.cc9
-rw-r--r--src/lib/film.cc4
-rw-r--r--src/lib/film.h1
-rw-r--r--src/lib/image.cc22
-rw-r--r--src/lib/image_content.cc4
-rw-r--r--src/lib/image_proxy.cc5
-rw-r--r--src/lib/player.cc8
-rw-r--r--src/lib/player_video.cc2
-rw-r--r--src/lib/playlist.cc4
-rw-r--r--src/lib/ratio.cc3
-rw-r--r--src/lib/scaler.cc9
-rw-r--r--src/lib/sndfile_content.cc2
-rw-r--r--src/lib/subrip_content.cc4
-rw-r--r--src/lib/subtitle_content.cc2
-rw-r--r--src/lib/types.cc4
-rw-r--r--src/lib/util.cc6
-rw-r--r--src/lib/util.h5
-rw-r--r--src/lib/video_content.cc16
-rw-r--r--src/lib/video_content.h2
-rw-r--r--src/lib/video_content_scale.cc1
-rw-r--r--src/lib/video_decoder.cc2
-rw-r--r--src/lib/writer.cc10
-rw-r--r--src/wx/audio_dialog.cc4
-rw-r--r--src/wx/content_menu.cc12
-rw-r--r--src/wx/dcp_panel.cc2
-rw-r--r--src/wx/editable_list.h4
-rw-r--r--src/wx/hints_dialog.cc5
-rw-r--r--src/wx/kdm_dialog.cc2
-rw-r--r--src/wx/subtitle_panel.cc4
-rw-r--r--src/wx/timeline.cc6
-rw-r--r--src/wx/video_panel.cc6
47 files changed, 151 insertions, 127 deletions
diff --git a/src/lib/audio_analysis.cc b/src/lib/audio_analysis.cc
index 681917fcf..597c04a22 100644
--- a/src/lib/audio_analysis.cc
+++ b/src/lib/audio_analysis.cc
@@ -18,6 +18,7 @@
*/
#include "audio_analysis.h"
+#include "dcpomatic_assert.h"
#include "cross.h"
#include <boost/filesystem.hpp>
#include <stdint.h>
@@ -117,14 +118,14 @@ AudioAnalysis::AudioAnalysis (boost::filesystem::path filename)
void
AudioAnalysis::add_point (int c, AudioPoint const & p)
{
- assert (c < channels ());
+ DCPOMATIC_ASSERT (c < channels ());
_data[c].push_back (p);
}
AudioPoint
AudioAnalysis::get_point (int c, int p) const
{
- assert (p < points (c));
+ DCPOMATIC_ASSERT (p < points (c));
return _data[c][p];
}
@@ -137,7 +138,7 @@ AudioAnalysis::channels () const
int
AudioAnalysis::points (int c) const
{
- assert (c < channels ());
+ DCPOMATIC_ASSERT (c < channels ());
return _data[c].size ();
}
diff --git a/src/lib/audio_buffers.cc b/src/lib/audio_buffers.cc
index d1003cc8c..71422944d 100644
--- a/src/lib/audio_buffers.cc
+++ b/src/lib/audio_buffers.cc
@@ -18,6 +18,7 @@
*/
#include "audio_buffers.h"
+#include "dcpomatic_assert.h"
#include <cassert>
#include <cstring>
#include <cmath>
@@ -73,8 +74,8 @@ AudioBuffers::~AudioBuffers ()
void
AudioBuffers::allocate (int channels, int frames)
{
- assert (frames >= 0);
- assert (channels >= 0);
+ DCPOMATIC_ASSERT (frames >= 0);
+ DCPOMATIC_ASSERT (channels >= 0);
_channels = channels;
_frames = frames;
@@ -109,7 +110,7 @@ AudioBuffers::deallocate ()
float*
AudioBuffers::data (int c) const
{
- assert (c >= 0 && c < _channels);
+ DCPOMATIC_ASSERT (c >= 0 && c < _channels);
return _data[c];
}
@@ -121,7 +122,7 @@ AudioBuffers::data (int c) const
void
AudioBuffers::set_frames (int f)
{
- assert (f <= _allocated_frames);
+ DCPOMATIC_ASSERT (f <= _allocated_frames);
for (int c = 0; c < _channels; ++c) {
for (int i = f; i < _frames; ++i) {
@@ -147,7 +148,7 @@ AudioBuffers::make_silent ()
void
AudioBuffers::make_silent (int c)
{
- assert (c >= 0 && c < _channels);
+ DCPOMATIC_ASSERT (c >= 0 && c < _channels);
for (int i = 0; i < _frames; ++i) {
_data[c][i] = 0;
@@ -157,7 +158,7 @@ AudioBuffers::make_silent (int c)
void
AudioBuffers::make_silent (int from, int frames)
{
- assert ((from + frames) <= _allocated_frames);
+ DCPOMATIC_ASSERT ((from + frames) <= _allocated_frames);
for (int c = 0; c < _channels; ++c) {
for (int i = from; i < (from + frames); ++i) {
@@ -180,11 +181,11 @@ AudioBuffers::copy_from (AudioBuffers const * from, int frames_to_copy, int read
return;
}
- assert (from->channels() == channels());
+ DCPOMATIC_ASSERT (from->channels() == channels());
- assert (from);
- assert (read_offset >= 0 && (read_offset + frames_to_copy) <= from->_allocated_frames);
- assert (write_offset >= 0 && (write_offset + frames_to_copy) <= _allocated_frames);
+ DCPOMATIC_ASSERT (from);
+ DCPOMATIC_ASSERT (read_offset >= 0 && (read_offset + frames_to_copy) <= from->_allocated_frames);
+ DCPOMATIC_ASSERT (write_offset >= 0 && (write_offset + frames_to_copy) <= _allocated_frames);
for (int i = 0; i < _channels; ++i) {
memcpy (_data[i] + write_offset, from->_data[i] + read_offset, frames_to_copy * sizeof(float));
@@ -204,14 +205,14 @@ AudioBuffers::move (int from, int to, int frames)
return;
}
- assert (from >= 0);
- assert (from < _frames);
- assert (to >= 0);
- assert (to < _frames);
- assert (frames > 0);
- assert (frames <= _frames);
- assert ((from + frames) <= _frames);
- assert ((to + frames) <= _allocated_frames);
+ DCPOMATIC_ASSERT (from >= 0);
+ DCPOMATIC_ASSERT (from < _frames);
+ DCPOMATIC_ASSERT (to >= 0);
+ DCPOMATIC_ASSERT (to < _frames);
+ DCPOMATIC_ASSERT (frames > 0);
+ DCPOMATIC_ASSERT (frames <= _frames);
+ DCPOMATIC_ASSERT ((from + frames) <= _frames);
+ DCPOMATIC_ASSERT ((to + frames) <= _allocated_frames);
for (int i = 0; i < _channels; ++i) {
memmove (_data[i] + to, _data[i] + from, frames * sizeof(float));
@@ -225,8 +226,8 @@ void
AudioBuffers::accumulate_channel (AudioBuffers const * from, int from_channel, int to_channel, float gain)
{
int const N = frames ();
- assert (from->frames() == N);
- assert (to_channel <= _channels);
+ DCPOMATIC_ASSERT (from->frames() == N);
+ DCPOMATIC_ASSERT (to_channel <= _channels);
float* s = from->data (from_channel);
float* d = _data[to_channel];
@@ -262,9 +263,9 @@ AudioBuffers::ensure_size (int frames)
void
AudioBuffers::accumulate_frames (AudioBuffers const * from, int read_offset, int write_offset, int frames)
{
- assert (_channels == from->channels ());
- assert (read_offset >= 0);
- assert (write_offset >= 0);
+ DCPOMATIC_ASSERT (_channels == from->channels ());
+ DCPOMATIC_ASSERT (read_offset >= 0);
+ DCPOMATIC_ASSERT (write_offset >= 0);
for (int i = 0; i < _channels; ++i) {
for (int j = 0; j < frames; ++j) {
@@ -300,7 +301,7 @@ AudioBuffers::channel (int c) const
void
AudioBuffers::copy_channel_from (AudioBuffers const * from, int from_channel, int to_channel)
{
- assert (from->frames() == frames());
+ DCPOMATIC_ASSERT (from->frames() == frames());
memcpy (data(to_channel), from->data(from_channel), frames() * sizeof (float));
}
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc
index c0e99b24c..61357c60f 100644
--- a/src/lib/audio_content.cc
+++ b/src/lib/audio_content.cc
@@ -90,7 +90,7 @@ AudioContent::AudioContent (shared_ptr<const Film> f, vector<shared_ptr<Content>
: Content (f, c)
{
shared_ptr<AudioContent> ref = dynamic_pointer_cast<AudioContent> (c[0]);
- assert (ref);
+ DCPOMATIC_ASSERT (ref);
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<AudioContent> ac = dynamic_pointer_cast<AudioContent> (c[i]);
@@ -163,7 +163,7 @@ boost::signals2::connection
AudioContent::analyse_audio (boost::function<void()> finished)
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, dynamic_pointer_cast<AudioContent> (shared_from_this())));
boost::signals2::connection c = job->Finished.connect (finished);
@@ -210,7 +210,7 @@ int
AudioContent::resampled_audio_frame_rate () const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
/* Resample to a DCI-approved sample rate */
double t = dcp_audio_frame_rate (audio_frame_rate ());
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc
index 31dcf2ef9..0c47b9f51 100644
--- a/src/lib/audio_decoder.cc
+++ b/src/lib/audio_decoder.cc
@@ -166,7 +166,7 @@ AudioDecoder::audio (shared_ptr<const AudioBuffers> data, ContentTime time)
_audio_position = time.frames (frame_rate);
}
- assert (_audio_position.get() >= (_decoded_audio.frame + _decoded_audio.audio->frames()));
+ DCPOMATIC_ASSERT (_audio_position.get() >= (_decoded_audio.frame + _decoded_audio.audio->frames()));
add (data);
}
diff --git a/src/lib/cinema_sound_processor.cc b/src/lib/cinema_sound_processor.cc
index 485af3fd6..367cea81e 100644
--- a/src/lib/cinema_sound_processor.cc
+++ b/src/lib/cinema_sound_processor.cc
@@ -23,6 +23,7 @@
#include "cinema_sound_processor.h"
#include "dolby_cp750.h"
+#include "dcpomatic_assert.h"
#include <iostream>
#include <cassert>
@@ -98,6 +99,6 @@ CinemaSoundProcessor::as_index (CinemaSoundProcessor const * s)
CinemaSoundProcessor const *
CinemaSoundProcessor::from_index (int i)
{
- assert (i <= int(_cinema_sound_processors.size ()));
+ DCPOMATIC_ASSERT (i <= int(_cinema_sound_processors.size ()));
return _cinema_sound_processors[i];
}
diff --git a/src/lib/content.cc b/src/lib/content.cc
index ba83e2627..a8d058cc1 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -270,7 +270,7 @@ Content::path_summary () const
{
/* XXX: should handle multiple paths more gracefully */
- assert (number_of_paths ());
+ DCPOMATIC_ASSERT (number_of_paths ());
string s = path(0).filename().string ();
if (number_of_paths() > 1) {
diff --git a/src/lib/content_subtitle.cc b/src/lib/content_subtitle.cc
index 93e0677bb..39becf943 100644
--- a/src/lib/content_subtitle.cc
+++ b/src/lib/content_subtitle.cc
@@ -23,7 +23,7 @@ ContentTimePeriod
ContentTextSubtitle::period () const
{
/* XXX: assuming we have some subs and they are all at the same time */
- assert (!subs.empty ());
+ DCPOMATIC_ASSERT (!subs.empty ());
return ContentTimePeriod (
ContentTime::from_seconds (double (subs.front().in().to_ticks()) / 250),
ContentTime::from_seconds (double (subs.front().out().to_ticks()) / 250)
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index cd82ee6e9..2bf14dcff 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -139,7 +139,7 @@ DCPTime
DCPContent::full_length () const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
return DCPTime (video_length (), FrameRateChange (video_frame_rate (), film->video_frame_rate ()));
}
diff --git a/src/lib/dcp_content_type.cc b/src/lib/dcp_content_type.cc
index e659a9b88..b7bf8d81a 100644
--- a/src/lib/dcp_content_type.cc
+++ b/src/lib/dcp_content_type.cc
@@ -22,6 +22,7 @@
*/
#include "dcp_content_type.h"
+#include "dcpomatic_assert.h"
#include <cassert>
#include "i18n.h"
@@ -80,7 +81,7 @@ DCPContentType::from_isdcf_name (string n)
DCPContentType const *
DCPContentType::from_index (int n)
{
- assert (n >= 0 && n < int (_dcp_content_types.size ()));
+ DCPOMATIC_ASSERT (n >= 0 && n < int (_dcp_content_types.size ()));
return _dcp_content_types[n];
}
diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc
index 74affe857..f6d632f92 100644
--- a/src/lib/dcp_decoder.cc
+++ b/src/lib/dcp_decoder.cc
@@ -49,7 +49,7 @@ DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c)
if (c->kdm ()) {
dcp.add (dcp::DecryptedKDM (c->kdm().get (), Config::instance()->decryption_private_key ()));
}
- assert (dcp.cpls().size() == 1);
+ DCPOMATIC_ASSERT (dcp.cpls().size() == 1);
_reels = dcp.cpls().front()->reels ();
_reel = _reels.begin ();
}
diff --git a/src/lib/dcp_video.h b/src/lib/dcp_video.h
index 051333c45..9a6ae8d91 100644
--- a/src/lib/dcp_video.h
+++ b/src/lib/dcp_video.h
@@ -20,6 +20,7 @@
#include "util.h"
#include <dcp/picture_mxf_writer.h>
+#include <libcxml/cxml.h>
/** @file src/dcp_video_frame.h
* @brief A single frame of video destined for a DCP.
diff --git a/src/lib/dcpomatic_time.h b/src/lib/dcpomatic_time.h
index 2408bff81..6afce554f 100644
--- a/src/lib/dcpomatic_time.h
+++ b/src/lib/dcpomatic_time.h
@@ -22,6 +22,7 @@
#include "frame_rate_change.h"
#include "safe_stringstream.h"
+#include "dcpomatic_assert.h"
#include <stdint.h>
#include <cmath>
#include <ostream>
@@ -177,7 +178,7 @@ public:
template <class T>
static ContentTime from_frames (int64_t f, T r) {
- assert (r > 0);
+ DCPOMATIC_ASSERT (r > 0);
return ContentTime (f * HZ / r);
}
@@ -281,7 +282,7 @@ public:
template <class T>
static DCPTime from_frames (int64_t f, T r) {
- assert (r > 0);
+ DCPOMATIC_ASSERT (r > 0);
return DCPTime (f * HZ / r);
}
diff --git a/src/lib/exceptions.cc b/src/lib/exceptions.cc
index 95d4c8cce..c4c3d0815 100644
--- a/src/lib/exceptions.cc
+++ b/src/lib/exceptions.cc
@@ -73,3 +73,9 @@ InvalidSignerError::InvalidSignerError ()
{
}
+
+ProgrammingError::ProgrammingError (string file, int line)
+ : StringError (String::compose (_("Programming error at %1:%2"), file, line))
+{
+
+}
diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h
index 05c66df3a..950c2f381 100644
--- a/src/lib/exceptions.h
+++ b/src/lib/exceptions.h
@@ -259,6 +259,12 @@ public:
InvalidSignerError ();
};
+class ProgrammingError : public StringError
+{
+public:
+ ProgrammingError (std::string file, int line);
+};
+
/** @class ExceptionStore
* @brief A parent class for classes which have a need to catch and
* re-throw exceptions.
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index e09e71041..740efdc29 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -106,7 +106,7 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> f, vector<boost::shared_ptr
, SubtitleContent (f, c)
{
shared_ptr<FFmpegContent> ref = dynamic_pointer_cast<FFmpegContent> (c[0]);
- assert (ref);
+ DCPOMATIC_ASSERT (ref);
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c[i]);
@@ -173,7 +173,7 @@ FFmpegContent::examine (shared_ptr<Job> job, bool calculate_digest)
take_from_video_examiner (examiner);
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
{
boost::mutex::scoped_lock lm (_mutex);
@@ -315,7 +315,7 @@ DCPTime
FFmpegContent::full_length () const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
return DCPTime (video_length_after_3d_combine(), FrameRateChange (video_frame_rate (), film->video_frame_rate ()));
}
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index 62a3a78c3..a16799e74 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -168,12 +168,12 @@ FFmpegDecoder::pass ()
shared_ptr<AudioBuffers>
FFmpegDecoder::deinterleave_audio (uint8_t** data, int size)
{
- assert (_ffmpeg_content->audio_channels());
- assert (bytes_per_audio_sample());
+ DCPOMATIC_ASSERT (_ffmpeg_content->audio_channels());
+ DCPOMATIC_ASSERT (bytes_per_audio_sample());
/* Deinterleave and convert to float */
- assert ((size % (bytes_per_audio_sample() * _ffmpeg_content->audio_channels())) == 0);
+ DCPOMATIC_ASSERT ((size % (bytes_per_audio_sample() * _ffmpeg_content->audio_channels())) == 0);
int const total_samples = size / bytes_per_audio_sample();
int const frames = total_samples / _ffmpeg_content->audio_channels();
diff --git a/src/lib/ffmpeg_stream.cc b/src/lib/ffmpeg_stream.cc
index 3fac33327..ad99defee 100644
--- a/src/lib/ffmpeg_stream.cc
+++ b/src/lib/ffmpeg_stream.cc
@@ -17,12 +17,13 @@
*/
+#include "ffmpeg_stream.h"
+#include "dcpomatic_assert.h"
+#include <dcp/raw_convert.h>
+#include <libxml++/libxml++.h>
extern "C" {
#include <libavformat/avformat.h>
}
-#include <libxml++/libxml++.h>
-#include <dcp/raw_convert.h>
-#include "ffmpeg_stream.h"
using std::string;
using dcp::raw_convert;
@@ -66,6 +67,6 @@ FFmpegStream::stream (AVFormatContext const * fc) const
++i;
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
return 0;
}
diff --git a/src/lib/film.cc b/src/lib/film.cc
index d7620be8d..18e992478 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -164,7 +164,7 @@ Film::Film (boost::filesystem::path dir, bool log)
string
Film::video_identifier () const
{
- assert (container ());
+ DCPOMATIC_ASSERT (container ());
SafeStringStream s;
s.imbue (std::locale::classic ());
@@ -1069,7 +1069,7 @@ Film::full_frame () const
return dcp::Size (4096, 2160);
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
return dcp::Size ();
}
diff --git a/src/lib/film.h b/src/lib/film.h
index 0227f26c9..43f7bae78 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -29,6 +29,7 @@
#include "types.h"
#include "isdcf_metadata.h"
#include "frame_rate_change.h"
+#include "ratio.h"
#include <dcp/key.h>
#include <dcp/encrypted_kdm.h>
#include <boost/signals2.hpp>
diff --git a/src/lib/image.cc b/src/lib/image.cc
index 3c6769068..847ad1046 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -88,14 +88,14 @@ Image::components () const
shared_ptr<Image>
Image::crop_scale_window (Crop crop, dcp::Size inter_size, dcp::Size out_size, Scaler const * scaler, AVPixelFormat out_format, bool out_aligned) const
{
- assert (scaler);
+ DCPOMATIC_ASSERT (scaler);
/* Empirical testing suggests that sws_scale() will crash if
the input image is not aligned.
*/
- assert (aligned ());
+ DCPOMATIC_ASSERT (aligned ());
- assert (out_size.width >= inter_size.width);
- assert (out_size.height >= inter_size.height);
+ DCPOMATIC_ASSERT (out_size.width >= inter_size.width);
+ DCPOMATIC_ASSERT (out_size.height >= inter_size.height);
/* Here's an image of out_size */
shared_ptr<Image> out (new Image (out_format, out_size, out_aligned));
@@ -144,11 +144,11 @@ Image::crop_scale_window (Crop crop, dcp::Size inter_size, dcp::Size out_size, S
shared_ptr<Image>
Image::scale (dcp::Size out_size, Scaler const * scaler, AVPixelFormat out_format, bool out_aligned) const
{
- assert (scaler);
+ DCPOMATIC_ASSERT (scaler);
/* Empirical testing suggests that sws_scale() will crash if
the input image is not aligned.
*/
- assert (aligned ());
+ DCPOMATIC_ASSERT (aligned ());
shared_ptr<Image> scaled (new Image (out_format, out_size, out_aligned));
@@ -361,7 +361,7 @@ Image::make_transparent ()
void
Image::alpha_blend (shared_ptr<const Image> other, Position<int> position)
{
- assert (other->pixel_format() == PIX_FMT_RGBA);
+ DCPOMATIC_ASSERT (other->pixel_format() == PIX_FMT_RGBA);
int const other_bpp = 4;
int start_tx = position.x;
@@ -439,7 +439,7 @@ Image::alpha_blend (shared_ptr<const Image> other, Position<int> position)
break;
}
default:
- assert (false);
+ DCPOMATIC_ASSERT (false);
}
}
@@ -447,8 +447,8 @@ void
Image::copy (shared_ptr<const Image> other, Position<int> position)
{
/* Only implemented for RGB24 onto RGB24 so far */
- assert (_pixel_format == PIX_FMT_RGB24 && other->pixel_format() == PIX_FMT_RGB24);
- assert (position.x >= 0 && position.y >= 0);
+ DCPOMATIC_ASSERT (_pixel_format == PIX_FMT_RGB24 && other->pixel_format() == PIX_FMT_RGB24);
+ DCPOMATIC_ASSERT (position.x >= 0 && position.y >= 0);
int const N = min (position.x + other->size().width, size().width) - position.x;
for (int ty = position.y, oy = 0; ty < size().height && oy < other->size().height; ++ty, ++oy) {
@@ -609,7 +609,7 @@ Image::Image (shared_ptr<const Image> other, bool aligned)
allocate ();
for (int i = 0; i < components(); ++i) {
- assert(line_size()[i] == other->line_size()[i]);
+ DCPOMATIC_ASSERT (line_size()[i] == other->line_size()[i]);
uint8_t* p = _data[i];
uint8_t* q = other->data()[i];
for (int j = 0; j < lines(i); ++j) {
diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc
index 132b26144..b8d2a6921 100644
--- a/src/lib/image_content.cc
+++ b/src/lib/image_content.cc
@@ -105,7 +105,7 @@ ImageContent::examine (shared_ptr<Job> job, bool calculate_digest)
Content::examine (job, calculate_digest);
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
shared_ptr<ImageExaminer> examiner (new ImageExaminer (film, shared_from_this(), job));
take_from_video_examiner (examiner);
@@ -126,7 +126,7 @@ DCPTime
ImageContent::full_length () const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
return DCPTime (video_length_after_3d_combine(), FrameRateChange (video_frame_rate(), film->video_frame_rate()));
}
diff --git a/src/lib/image_proxy.cc b/src/lib/image_proxy.cc
index 7013a69c9..f72a6c3e4 100644
--- a/src/lib/image_proxy.cc
+++ b/src/lib/image_proxy.cc
@@ -17,8 +17,6 @@
*/
-#include <dcp/util.h>
-#include <dcp/raw_convert.h>
#include "image_proxy.h"
#include "raw_image_proxy.h"
#include "magick_image_proxy.h"
@@ -26,6 +24,9 @@
#include "image.h"
#include "exceptions.h"
#include "cross.h"
+#include <dcp/util.h>
+#include <dcp/raw_convert.h>
+#include <libcxml/cxml.h>
#include "i18n.h"
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 695ce00ce..36b13d105 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -337,9 +337,9 @@ Player::get_video (DCPTime time, bool accurate)
shared_ptr<Piece> piece = ov.back ();
shared_ptr<VideoDecoder> decoder = dynamic_pointer_cast<VideoDecoder> (piece->decoder);
- assert (decoder);
+ DCPOMATIC_ASSERT (decoder);
shared_ptr<VideoContent> content = dynamic_pointer_cast<VideoContent> (piece->content);
- assert (content);
+ DCPOMATIC_ASSERT (content);
list<ContentVideo> content_video = decoder->get_video (dcp_to_content_video (piece, time), accurate);
if (content_video.empty ()) {
@@ -415,9 +415,9 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate)
for (list<shared_ptr<Piece> >::iterator i = ov.begin(); i != ov.end(); ++i) {
shared_ptr<AudioContent> content = dynamic_pointer_cast<AudioContent> ((*i)->content);
- assert (content);
+ DCPOMATIC_ASSERT (content);
shared_ptr<AudioDecoder> decoder = dynamic_pointer_cast<AudioDecoder> ((*i)->decoder);
- assert (decoder);
+ DCPOMATIC_ASSERT (decoder);
if (content->audio_frame_rate() == 0) {
/* This AudioContent has no audio (e.g. if it is an FFmpegContent with no
diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc
index b7a8f8669..fae66bf62 100644
--- a/src/lib/player_video.cc
+++ b/src/lib/player_video.cc
@@ -179,7 +179,7 @@ shared_ptr<EncodedData>
PlayerVideo::j2k () const
{
shared_ptr<const J2KImageProxy> j2k = dynamic_pointer_cast<const J2KImageProxy> (_in);
- assert (j2k);
+ DCPOMATIC_ASSERT (j2k);
return j2k->j2k ();
}
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index 4580e54d4..1698da99e 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -367,7 +367,7 @@ Playlist::move_earlier (shared_ptr<Content> c)
++i;
}
- assert (i != _content.end ());
+ DCPOMATIC_ASSERT (i != _content.end ());
if (previous == _content.end ()) {
return;
}
@@ -389,7 +389,7 @@ Playlist::move_later (shared_ptr<Content> c)
++i;
}
- assert (i != _content.end ());
+ DCPOMATIC_ASSERT (i != _content.end ());
ContentList::iterator next = i;
++next;
diff --git a/src/lib/ratio.cc b/src/lib/ratio.cc
index bc83ae87c..29c22c78d 100644
--- a/src/lib/ratio.cc
+++ b/src/lib/ratio.cc
@@ -17,9 +17,10 @@
*/
-#include <dcp/types.h>
#include "ratio.h"
#include "util.h"
+#include <dcp/types.h>
+#include <cfloat>
#include "i18n.h"
diff --git a/src/lib/scaler.cc b/src/lib/scaler.cc
index 40a0f05b9..43c1ac81c 100644
--- a/src/lib/scaler.cc
+++ b/src/lib/scaler.cc
@@ -21,12 +21,13 @@
* @brief A class to describe one of FFmpeg's software scalers.
*/
-#include <iostream>
-#include <cassert>
+#include "dcpomatic_assert.h"
+#include "scaler.h"
extern "C" {
#include <libswscale/swscale.h>
}
-#include "scaler.h"
+#include <iostream>
+#include <cassert>
#include "i18n.h"
@@ -112,6 +113,6 @@ Scaler::as_index (Scaler const * s)
Scaler const *
Scaler::from_index (int i)
{
- assert (i <= int(_scalers.size ()));
+ DCPOMATIC_ASSERT (i <= int(_scalers.size ()));
return _scalers[i];
}
diff --git a/src/lib/sndfile_content.cc b/src/lib/sndfile_content.cc
index cdc9734bf..3c377d644 100644
--- a/src/lib/sndfile_content.cc
+++ b/src/lib/sndfile_content.cc
@@ -113,7 +113,7 @@ DCPTime
SndfileContent::full_length () const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
return DCPTime (audio_length(), film->active_frame_rate_change (position ()));
}
diff --git a/src/lib/subrip_content.cc b/src/lib/subrip_content.cc
index 992947a2d..f4dd427f3 100644
--- a/src/lib/subrip_content.cc
+++ b/src/lib/subrip_content.cc
@@ -56,7 +56,7 @@ SubRipContent::examine (boost::shared_ptr<Job> job, bool calculate_digest)
SubRip s (shared_from_this ());
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
DCPTime len (s.length (), film->active_frame_rate_change (position ()));
@@ -80,7 +80,7 @@ SubRipContent::technical_summary () const
string
SubRipContent::information () const
{
-
+
}
void
diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc
index 6f9bdf3a4..2bed5413c 100644
--- a/src/lib/subtitle_content.cc
+++ b/src/lib/subtitle_content.cc
@@ -105,7 +105,7 @@ SubtitleContent::SubtitleContent (shared_ptr<const Film> f, vector<shared_ptr<Co
: Content (f, c)
{
shared_ptr<SubtitleContent> ref = dynamic_pointer_cast<SubtitleContent> (c[0]);
- assert (ref);
+ DCPOMATIC_ASSERT (ref);
list<shared_ptr<Font> > ref_fonts = ref->fonts ();
for (size_t i = 0; i < c.size(); ++i) {
diff --git a/src/lib/types.cc b/src/lib/types.cc
index d052b2a9a..54a8cb492 100644
--- a/src/lib/types.cc
+++ b/src/lib/types.cc
@@ -51,7 +51,7 @@ resolution_to_string (Resolution r)
return "4K";
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
return "";
}
@@ -67,7 +67,7 @@ string_to_resolution (string s)
return RESOLUTION_4K;
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
return RESOLUTION_2K;
}
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 502393094..0cdfe0b0c 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -708,7 +708,7 @@ stride_round_up (int c, int const * stride, int t)
int
round_to (float n, int r)
{
- assert (r == 1 || r == 2 || r == 4);
+ DCPOMATIC_ASSERT (r == 1 || r == 2 || r == 4);
return int (n + float(r) / 2) &~ (r - 1);
}
@@ -813,13 +813,13 @@ get_optional_int (multimap<string, string> const & kv, string k)
void
ensure_ui_thread ()
{
- assert (boost::this_thread::get_id() == ui_thread);
+ DCPOMATIC_ASSERT (boost::this_thread::get_id() == ui_thread);
}
string
audio_channel_name (int c)
{
- assert (MAX_DCP_AUDIO_CHANNELS == 12);
+ DCPOMATIC_ASSERT (MAX_DCP_AUDIO_CHANNELS == 12);
/// TRANSLATORS: these are the names of audio channels; Lfe (sub) is the low-frequency
/// enhancement channel (sub-woofer). HI is the hearing-impaired audio track and
diff --git a/src/lib/util.h b/src/lib/util.h
index f5d0b3aca..1c122b70c 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -27,7 +27,8 @@
#include "compose.hpp"
#include "types.h"
-#include "video_content.h"
+#include "exceptions.h"
+#include "dcpomatic_time.h"
#include <dcp/util.h>
extern "C" {
#include <libavcodec/avcodec.h>
@@ -125,7 +126,7 @@ private:
int _timeout;
};
-extern int64_t video_frames_to_audio_frames (VideoContent::Frame v, float audio_sample_rate, float frames_per_second);
+extern int64_t video_frames_to_audio_frames (VideoFrame v, float audio_sample_rate, float frames_per_second);
/** @class ScopedTemporary
* @brief A temporary file which is deleted when the ScopedTemporary object goes out of scope.
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 1da5d87c1..c50d466a1 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -136,7 +136,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f, vector<shared_ptr<Content>
, _video_length (0)
{
shared_ptr<VideoContent> ref = dynamic_pointer_cast<VideoContent> (c[0]);
- assert (ref);
+ DCPOMATIC_ASSERT (ref);
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (c[i]);
@@ -240,7 +240,7 @@ VideoContent::take_from_video_examiner (shared_ptr<VideoExaminer> d)
}
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
LOG_GENERAL ("Video length obtained from header as %1 frames", _video_length.frames (_video_frame_rate));
signal_changed (VideoContentProperty::VIDEO_SIZE);
@@ -413,7 +413,7 @@ VideoContent::video_size_after_3d_split () const
return dcp::Size (s.width, s.height / 2);
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
}
void
@@ -474,7 +474,7 @@ ContentTime
VideoContent::dcp_time_to_content_time (DCPTime t) const
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
return ContentTime (t, FrameRateChange (video_frame_rate(), film->video_frame_rate()));
}
@@ -482,7 +482,7 @@ void
VideoContent::scale_and_crop_to_fit_width ()
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
set_scale (VideoContentScale (film->container ()));
@@ -495,7 +495,7 @@ void
VideoContent::scale_and_crop_to_fit_height ()
{
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
set_scale (VideoContentScale (film->container ()));
@@ -522,7 +522,7 @@ VideoContent::set_video_frame_rate (float r)
optional<float>
VideoContent::fade (VideoFrame f) const
{
- assert (f >= 0);
+ DCPOMATIC_ASSERT (f >= 0);
if (f < fade_in().frames (video_frame_rate ())) {
return float (f) / _fade_in.frames (video_frame_rate ());
@@ -563,7 +563,7 @@ VideoContent::processing_description () const
}
shared_ptr<const Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
dcp::Size const container_size = film->frame_size ();
dcp::Size const scaled = scale().size (dynamic_pointer_cast<const VideoContent> (shared_from_this ()), container_size, container_size, 1);
diff --git a/src/lib/video_content.h b/src/lib/video_content.h
index 30dcac231..9e5c1362f 100644
--- a/src/lib/video_content.h
+++ b/src/lib/video_content.h
@@ -43,8 +43,6 @@ public:
class VideoContent : public virtual Content
{
public:
- typedef int Frame;
-
VideoContent (boost::shared_ptr<const Film>);
VideoContent (boost::shared_ptr<const Film>, DCPTime, ContentTime);
VideoContent (boost::shared_ptr<const Film>, boost::filesystem::path);
diff --git a/src/lib/video_content_scale.cc b/src/lib/video_content_scale.cc
index 9bb35189e..aebafc8e5 100644
--- a/src/lib/video_content_scale.cc
+++ b/src/lib/video_content_scale.cc
@@ -18,6 +18,7 @@
*/
#include "video_content_scale.h"
+#include "video_content.h"
#include "ratio.h"
#include "safe_stringstream.h"
#include "util.h"
diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc
index cab1a979f..b861f49e5 100644
--- a/src/lib/video_decoder.cc
+++ b/src/lib/video_decoder.cc
@@ -261,7 +261,7 @@ VideoDecoder::video (shared_ptr<const ImageProxy> image, VideoFrame frame)
to_push.push_back (ContentVideo (image, EYES_RIGHT, PART_WHOLE, frame));
break;
default:
- assert (false);
+ DCPOMATIC_ASSERT (false);
}
/* Now VideoDecoder is required never to have gaps in the frames that it presents
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 07b637d46..512973f46 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -87,7 +87,7 @@ Writer::Writer (shared_ptr<const Film> f, weak_ptr<Job> j)
boost::filesystem::remove_all (_film->dir (_film->dcp_name ()));
shared_ptr<Job> job = _job.lock ();
- assert (job);
+ DCPOMATIC_ASSERT (job);
job->sub (_("Checking existing image data"));
check_existing_picture_mxf ();
@@ -308,7 +308,7 @@ try
_last_written_eyes = qi.eyes;
shared_ptr<Job> job = _job.lock ();
- assert (job);
+ DCPOMATIC_ASSERT (job);
int64_t total = _film->length().frames (_film->video_frame_rate ());
if (_film->three_d ()) {
/* _full_written and so on are incremented for each eye, so we need to double the total
@@ -333,7 +333,7 @@ try
++i;
}
- assert (i != _queue.rend());
+ DCPOMATIC_ASSERT (i != _queue.rend());
QueueItem qi = *i;
++_pushed_to_disk;
@@ -483,7 +483,7 @@ Writer::finish ()
cpl->add (reel);
shared_ptr<Job> job = _job.lock ();
- assert (job);
+ DCPOMATIC_ASSERT (job);
job->sub (_("Computing image digest"));
_picture_mxf->hash (boost::bind (&Job::set_progress, job.get(), _1, false));
@@ -571,7 +571,7 @@ Writer::check_existing_picture_mxf ()
while (true) {
shared_ptr<Job> job = _job.lock ();
- assert (job);
+ DCPOMATIC_ASSERT (job);
if (N > 0) {
job->set_progress (float (_first_nonexistant_frame) / N);
diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc
index 1f882e61f..1d41fc185 100644
--- a/src/wx/audio_dialog.cc
+++ b/src/wx/audio_dialog.cc
@@ -163,7 +163,7 @@ AudioDialog::channel_clicked (wxCommandEvent& ev)
++c;
}
- assert (c < MAX_DCP_AUDIO_CHANNELS);
+ DCPOMATIC_ASSERT (c < MAX_DCP_AUDIO_CHANNELS);
_plot->set_channel_visible (c, _channel_checkbox[c]->GetValue ());
}
@@ -186,7 +186,7 @@ AudioDialog::type_clicked (wxCommandEvent& ev)
++t;
}
- assert (t < AudioPoint::COUNT);
+ DCPOMATIC_ASSERT (t < AudioPoint::COUNT);
_plot->set_type_visible (t, _type_checkbox[t]->GetValue ());
}
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index c528447ac..15a234184 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -136,7 +136,7 @@ ContentMenu::join ()
}
}
- assert (fc.size() > 1);
+ DCPOMATIC_ASSERT (fc.size() > 1);
shared_ptr<Film> film = _film.lock ();
if (!film) {
@@ -245,8 +245,8 @@ ContentMenu::maybe_found_missing (weak_ptr<Job> j, weak_ptr<Content> oc, weak_pt
shared_ptr<Content> old_content = oc.lock ();
shared_ptr<Content> new_content = nc.lock ();
- assert (old_content);
- assert (new_content);
+ DCPOMATIC_ASSERT (old_content);
+ DCPOMATIC_ASSERT (new_content);
if (new_content->digest() != old_content->digest()) {
error_dialog (0, _("The content file(s) you specified are not the same as those that are missing. Either try again with the correct content file or remove the missing content."));
@@ -259,16 +259,16 @@ ContentMenu::maybe_found_missing (weak_ptr<Job> j, weak_ptr<Content> oc, weak_pt
void
ContentMenu::kdm ()
{
- assert (!_content.empty ());
+ DCPOMATIC_ASSERT (!_content.empty ());
shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (_content.front ());
- assert (dcp);
+ DCPOMATIC_ASSERT (dcp);
wxFileDialog* d = new wxFileDialog (_parent, _("Select KDM"));
if (d->ShowModal() == wxID_OK) {
dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()))));
shared_ptr<Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
film->examine_content (dcp, true);
}
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index 18ba4ccfd..5b2d18f23 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -361,7 +361,7 @@ DCPPanel::container_changed ()
int const n = _container->GetSelection ();
if (n >= 0) {
vector<Ratio const *> ratios = Ratio::all ();
- assert (n < int (ratios.size()));
+ DCPOMATIC_ASSERT (n < int (ratios.size()));
_film->set_container (ratios[n]);
}
}
diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h
index 481a14741..4119b889e 100644
--- a/src/wx/editable_list.h
+++ b/src/wx/editable_list.h
@@ -132,7 +132,7 @@ private:
}
std::vector<T> all = _get ();
- assert (item >= 0 && item < int (all.size ()));
+ DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ()));
T copy (all[item]);
add_to_control (copy);
@@ -149,7 +149,7 @@ private:
}
std::vector<T> all = _get ();
- assert (item >= 0 && item < int (all.size ()));
+ DCPOMATIC_ASSERT (item >= 0 && item < int (all.size ()));
S* dialog = new S (this);
dialog->set (all[item]);
diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc
index 9f8956948..b5d5c6971 100644
--- a/src/wx/hints_dialog.cc
+++ b/src/wx/hints_dialog.cc
@@ -17,11 +17,12 @@
*/
-#include <boost/algorithm/string.hpp>
-#include <wx/richtext/richtextctrl.h>
#include "lib/film.h"
#include "lib/ratio.h"
+#include "lib/video_content.h"
#include "hints_dialog.h"
+#include <boost/algorithm/string.hpp>
+#include <wx/richtext/richtextctrl.h>
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index 6a1f8051f..9b1d6bc98 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -472,7 +472,7 @@ boost::filesystem::path
KDMDialog::cpl () const
{
int const item = _cpl->GetSelection ();
- assert (item >= 0);
+ DCPOMATIC_ASSERT (item >= 0);
return _cpls[item].cpl_file;
}
diff --git a/src/wx/subtitle_panel.cc b/src/wx/subtitle_panel.cc
index 07b987a67..1e137f233 100644
--- a/src/wx/subtitle_panel.cc
+++ b/src/wx/subtitle_panel.cc
@@ -308,7 +308,7 @@ SubtitlePanel::subtitle_view_clicked ()
}
SubtitleContentList c = _parent->selected_subtitle ();
- assert (c.size() == 1);
+ DCPOMATIC_ASSERT (c.size() == 1);
shared_ptr<SubtitleDecoder> decoder;
@@ -337,7 +337,7 @@ SubtitlePanel::fonts_dialog_clicked ()
}
SubtitleContentList c = _parent->selected_subtitle ();
- assert (c.size() == 1);
+ DCPOMATIC_ASSERT (c.size() == 1);
_fonts_dialog = new FontsDialog (this, c.front ());
_fonts_dialog->Show ();
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index 556e6f1b3..6bce881a4 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -96,7 +96,7 @@ public:
dcpomatic::Rect<int> bbox () const
{
- assert (_track);
+ DCPOMATIC_ASSERT (_track);
shared_ptr<const Film> film = _timeline.film ();
shared_ptr<const Content> content = _content.lock ();
@@ -145,7 +145,7 @@ private:
void do_paint (wxGraphicsContext* gc)
{
- assert (_track);
+ DCPOMATIC_ASSERT (_track);
shared_ptr<const Film> film = _timeline.film ();
shared_ptr<const Content> cont = content ();
@@ -749,7 +749,7 @@ Timeline::set_position_from_event (wxMouseEvent& ev)
_down_view->content()->set_position (new_position);
shared_ptr<Film> film = _film.lock ();
- assert (film);
+ DCPOMATIC_ASSERT (film);
film->set_sequence_video (false);
}
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index 716c29dda..cdd2eb5de 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -48,8 +48,8 @@ static VideoContentScale
index_to_scale (int n)
{
vector<VideoContentScale> scales = VideoContentScale::all ();
- assert (n >= 0);
- assert (n < int (scales.size ()));
+ DCPOMATIC_ASSERT (n >= 0);
+ DCPOMATIC_ASSERT (n < int (scales.size ()));
return scales[n];
}
@@ -63,7 +63,7 @@ scale_to_index (VideoContentScale scale)
}
}
- assert (false);
+ DCPOMATIC_ASSERT (false);
}
VideoPanel::VideoPanel (ContentPanel* p)