diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-14 21:06:47 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-14 21:06:47 +0100 |
| commit | 009a58293bf2e9727d544d1a2648422cc395d81e (patch) | |
| tree | c581d457104195a0219a0197c523981756bf9ecd /src/lib/ab_transcoder.cc | |
| parent | b5001080a3e5b414f6cad1c52926ed757f2d8574 (diff) | |
| parent | ade28a703b15af710161faa017cddf95d66c4118 (diff) | |
Merge branch 'subs'
Diffstat (limited to 'src/lib/ab_transcoder.cc')
| -rw-r--r-- | src/lib/ab_transcoder.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/ab_transcoder.cc b/src/lib/ab_transcoder.cc index 1c20ae477..54153ec76 100644 --- a/src/lib/ab_transcoder.cc +++ b/src/lib/ab_transcoder.cc @@ -70,7 +70,7 @@ ABTranscoder::~ABTranscoder () } void -ABTranscoder::process_video (shared_ptr<Image> yuv, int frame, int index) +ABTranscoder::process_video (shared_ptr<Image> yuv, int frame, shared_ptr<Subtitle> sub, int index) { if (index == 0) { /* Keep this image around until we get the other half */ @@ -80,19 +80,20 @@ ABTranscoder::process_video (shared_ptr<Image> yuv, int frame, int index) for (int i = 0; i < yuv->components(); ++i) { int const line_size = yuv->line_size()[i]; int const half_line_size = line_size / 2; + int const stride = yuv->stride()[i]; uint8_t* p = _image->data()[i]; uint8_t* q = yuv->data()[i]; for (int j = 0; j < yuv->lines (i); ++j) { memcpy (p + half_line_size, q + half_line_size, half_line_size); - p += line_size; - q += line_size; + p += stride; + q += stride; } } /* And pass it to the encoder */ - _encoder->process_video (_image, frame); + _encoder->process_video (_image, frame, sub); _image.reset (); } |
