summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-06-02 23:03:08 +0100
committerCarl Hetherington <cth@carlh.net>2013-06-02 23:03:08 +0100
commita0856e3fbef17f24073b01cb96be6bbcb229ecbc (patch)
tree13fd6191f2c4d82943cbcfa1f34688552cfc1f8e /src/lib
parente6d086fff404d9fe5ac080f9e75334eeb315c1da (diff)
parent42866530db49e0faf367ad28a55c658be60951bf (diff)
Merge master.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc2
-rw-r--r--src/lib/ffmpeg_decoder.cc1
-rw-r--r--src/lib/film.cc4
-rw-r--r--src/lib/filter_graph.cc1
-rw-r--r--src/lib/image.cc8
-rw-r--r--src/lib/subtitle.cc10
-rw-r--r--src/lib/subtitle.h6
-rw-r--r--src/lib/util.h2
-rw-r--r--src/lib/video_content.cc2
9 files changed, 23 insertions, 13 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 978428b02..6fbd34d05 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -189,6 +189,8 @@ Config::file (bool old) const
{
boost::filesystem::path p;
p /= g_get_user_config_dir ();
+ boost::system::error_code ec;
+ boost::filesystem::create_directory (p, ec);
if (old) {
p /= ".dvdomatic";
} else {
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index 67587a564..1d000b62b 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -31,7 +31,6 @@
#include <stdint.h>
#include <boost/lexical_cast.hpp>
extern "C" {
-#include <tiffio.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
diff --git a/src/lib/film.cc b/src/lib/film.cc
index ef29d35fd..57e3791a2 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -170,6 +170,10 @@ Film::video_state_identifier () const
<< "_" << j2k_bandwidth()
<< "_" << lexical_cast<int> (colour_lut());
+ if (trim_type() == ENCODE) {
+ s << "_" << trim_start() << "_" << trim_end();
+ }
+
if (ab()) {
pair<string, string> fa = Filter::ffmpeg_strings (Config::instance()->reference_filters());
s << "ab_" << Config::instance()->reference_scaler()->id() << "_" << fa.first << "_" << fa.second;
diff --git a/src/lib/filter_graph.cc b/src/lib/filter_graph.cc
index 7ec2466c5..472480de3 100644
--- a/src/lib/filter_graph.cc
+++ b/src/lib/filter_graph.cc
@@ -154,6 +154,7 @@ FilterGraph::process (AVFrame* frame)
}
images.push_back (shared_ptr<Image> (new SimpleImage (_frame)));
+ av_frame_unref (_frame);
}
return images;
diff --git a/src/lib/image.cc b/src/lib/image.cc
index a12c61b3e..f0a38f4e9 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -68,7 +68,7 @@ Image::lines (int n) const
throw PixelFormatError (N_("lines()"), _pixel_format);
}
- return size().height / pow(2, d->log2_chroma_h);
+ return size().height / pow(2.0f, d->log2_chroma_h);
}
/** @return Number of components */
@@ -407,13 +407,13 @@ Image::bytes_per_pixel (int c) const
bpp[0] = floor ((d->comp[0].depth_minus1 + 1 + 7) / 8);
if (d->nb_components > 1) {
- bpp[1] = floor ((d->comp[1].depth_minus1 + 1 + 7) / 8) / pow (2, d->log2_chroma_w);
+ bpp[1] = floor ((d->comp[1].depth_minus1 + 1 + 7) / 8) / pow (2.0f, d->log2_chroma_w);
}
if (d->nb_components > 2) {
- bpp[2] = floor ((d->comp[2].depth_minus1 + 1 + 7) / 8) / pow (2, d->log2_chroma_w);
+ bpp[2] = floor ((d->comp[2].depth_minus1 + 1 + 7) / 8) / pow (2.0f, d->log2_chroma_w);
}
if (d->nb_components > 3) {
- bpp[3] = floor ((d->comp[3].depth_minus1 + 1 + 7) / 8) / pow (2, d->log2_chroma_w);
+ bpp[3] = floor ((d->comp[3].depth_minus1 + 1 + 7) / 8) / pow (2.0f, d->log2_chroma_w);
}
if ((d->flags & PIX_FMT_PLANAR) == 0) {
diff --git a/src/lib/subtitle.cc b/src/lib/subtitle.cc
index eafccd9b5..2815fccd8 100644
--- a/src/lib/subtitle.cc
+++ b/src/lib/subtitle.cc
@@ -110,13 +110,13 @@ Subtitle::Subtitle (Position p, shared_ptr<Image> i)
* in the coordinate space of the source.
* @param subtitle_scale scaling factor to apply to the subtitle image.
*/
-Rect
+dvdomatic::Rect
subtitle_transformed_area (
float target_x_scale, float target_y_scale,
- Rect sub_area, int subtitle_offset, float subtitle_scale
+ dvdomatic::Rect sub_area, int subtitle_offset, float subtitle_scale
)
{
- Rect tx;
+ dvdomatic::Rect tx;
sub_area.y += subtitle_offset;
@@ -145,8 +145,8 @@ subtitle_transformed_area (
}
/** @return area that this subtitle takes up, in the original uncropped source's coordinate space */
-Rect
+dvdomatic::Rect
Subtitle::area () const
{
- return Rect (_position.x, _position.y, _image->size().width, _image->size().height);
+ return dvdomatic::Rect (_position.x, _position.y, _image->size().width, _image->size().height);
}
diff --git a/src/lib/subtitle.h b/src/lib/subtitle.h
index 52bd35923..c3929d676 100644
--- a/src/lib/subtitle.h
+++ b/src/lib/subtitle.h
@@ -48,17 +48,17 @@ public:
return _image;
}
- Rect area () const;
+ dvdomatic::Rect area () const;
private:
Position _position;
boost::shared_ptr<Image> _image;
};
-Rect
+dvdomatic::Rect
subtitle_transformed_area (
float target_x_scale, float target_y_scale,
- Rect sub_area, int subtitle_offset, float subtitle_scale
+ dvdomatic::Rect sub_area, int subtitle_offset, float subtitle_scale
);
/** A Subtitle class with details of the time over which it should be shown */
diff --git a/src/lib/util.h b/src/lib/util.h
index 65859309d..be70eb259 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -45,6 +45,8 @@ extern "C" {
#define TIMING(...)
#endif
+#undef check
+
/** The maximum number of audio channels that we can cope with */
#define MAX_AUDIO_CHANNELS 6
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 18a128a5d..84dee81d1 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -39,6 +39,7 @@ using boost::optional;
VideoContent::VideoContent (shared_ptr<const Film> f, Time s, ContentVideoFrame len)
: Content (f, s)
, _video_length (len)
+ , _video_frame_rate (0)
, _ratio (0)
{
@@ -47,6 +48,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f, Time s, ContentVideoFrame
VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p)
: Content (f, p)
, _video_length (0)
+ , _video_frame_rate (0)
, _ratio (0)
{