summaryrefslogtreecommitdiff
path: root/src/lib/decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-14 13:02:57 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-14 13:02:57 +0100
commit48c8f23660184486efbb34df9d677108b0eab204 (patch)
treeac1a4ea6aa23ed159bbcf8d10d1000739b5ad252 /src/lib/decoder.cc
parentb1fc0de953b1c2fce8a31b267b63dfcaf67830c7 (diff)
Try moving subtitle adjustment for crop into the decoder.
Diffstat (limited to 'src/lib/decoder.cc')
-rw-r--r--src/lib/decoder.cc9
1 files changed, 9 insertions, 0 deletions
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<Subtitle> sub)
image->make_black ();
}
+ if (sub && _opt->apply_crop) {
+ list<shared_ptr<SubtitleImage> > im = sub->images ();
+ for (list<shared_ptr<SubtitleImage> >::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;