Tidy up test film naming.
[dcpomatic.git] / src / lib / ab_transcoder.cc
index aabaf2d03fa1ce4a28153009f6e27c35a4e91575..08938a2827e822dceecb7fdbad4420207d6a4f6c 100644 (file)
@@ -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 ();
        }
        
@@ -103,7 +104,7 @@ ABTranscoder::process_video (shared_ptr<Image> yuv, int frame, int index)
 void
 ABTranscoder::go ()
 {
-       _encoder->process_begin ();
+       _encoder->process_begin (_da->audio_channel_layout());
        _da->process_begin ();
        _db->process_begin ();
        
@@ -112,7 +113,7 @@ ABTranscoder::go ()
                bool const b = _db->pass ();
 
                if (_job) {
-                       _job->set_progress (float (_last_frame) / _da->decoding_frames ());
+                       _job->set_progress (float (_last_frame) / _fs_a->dcp_length());
                }
                
                if (a && b) {