From 48c8f23660184486efbb34df9d677108b0eab204 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 14 Oct 2012 13:02:57 +0100 Subject: Try moving subtitle adjustment for crop into the decoder. --- src/lib/decoder.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lib/decoder.cc') diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index e4b892ea4..c4759a872 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -48,6 +48,7 @@ extern "C" { #include "filter.h" #include "delay_line.h" #include "ffmpeg_compatibility.h" +#include "subtitle.h" using namespace std; using namespace boost; @@ -303,6 +304,14 @@ Decoder::process_video (AVFrame* frame, shared_ptr sub) image->make_black (); } + if (sub && _opt->apply_crop) { + list > im = sub->images (); + for (list >::iterator i = im.begin(); i != im.end(); ++i) { + Position p = (*i)->position (); + (*i)->set_position (Position (p.x - _fs->crop.left, p.y - _fs->crop.top)); + } + } + TIMING ("Decoder emits %1", _video_frame); Video (image, _video_frame, sub); ++_video_frame; -- cgit v1.2.3