summaryrefslogtreecommitdiff
path: root/src/lib/combiner.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-25 13:44:02 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-25 13:44:02 +0100
commit7b2ec1dd69951649f2c912fcf90b22913b1f6c3a (patch)
treeb25ae258f6bb14b06f6d8079f6bb8daf81811470 /src/lib/combiner.cc
parent6aa1a3e3808319d26659d3008a83f79f695fb6b2 (diff)
Remove Image::clone in favour of a copy constructor for SimpleImage; clean up A/B transcoder slightly; fix combiner if image strides differ; try to fix problems when destroying Encoders; fix SimpleImage copy constructor to cope with aligned images; don't call encoder::process_end if the encode throws an exception.
Diffstat (limited to 'src/lib/combiner.cc')
-rw-r--r--src/lib/combiner.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/combiner.cc b/src/lib/combiner.cc
index 250528aeb..367cefa7f 100644
--- a/src/lib/combiner.cc
+++ b/src/lib/combiner.cc
@@ -35,7 +35,7 @@ Combiner::Combiner (shared_ptr<Log> log)
void
Combiner::process_video (shared_ptr<const Image> image, bool, shared_ptr<Subtitle>, double)
{
- _image = image->clone ();
+ _image.reset (new SimpleImage (image));
}
/** Process video for the right half of the frame.
@@ -50,15 +50,14 @@ Combiner::process_video_b (shared_ptr<const Image> image, bool, shared_ptr<Subti
for (int i = 0; i < image->components(); ++i) {
int const line_size = image->line_size()[i];
int const half_line_size = line_size / 2;
- int const stride = image->stride()[i];
uint8_t* p = _image->data()[i];
uint8_t* q = image->data()[i];
for (int j = 0; j < image->lines (i); ++j) {
memcpy (p + half_line_size, q + half_line_size, half_line_size);
- p += stride;
- q += stride;
+ p += _image->stride()[i];
+ q += image->stride()[i];
}
}