diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-15 12:40:47 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-15 12:40:47 +0100 |
| commit | 43990add893eccf350f280e2dd3f947a94f3e9aa (patch) | |
| tree | 2dc1dcec95446a323460140c5afa44c45cfca487 /src/lib/subtitle.cc | |
| parent | 82e38014d0cc17f3c73b593f3da9c9923484665b (diff) | |
Some work on DCI naming. Clean up compacted / aligned image handling somewhat.
Diffstat (limited to 'src/lib/subtitle.cc')
| -rw-r--r-- | src/lib/subtitle.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/subtitle.cc b/src/lib/subtitle.cc index f0d77c511..0eb40b14e 100644 --- a/src/lib/subtitle.cc +++ b/src/lib/subtitle.cc @@ -48,7 +48,7 @@ Subtitle::displayed_at (double t) SubtitleImage::SubtitleImage (AVSubtitleRect const * rect) : _position (rect->x, rect->y) - , _image (new SimpleImage (PIX_FMT_RGBA, Size (rect->w, rect->h))) + , _image (new AlignedImage (PIX_FMT_RGBA, Size (rect->w, rect->h))) { if (rect->type != SUBTITLE_BITMAP) { throw DecodeError ("non-bitmap subtitles not yet supported"); @@ -63,10 +63,12 @@ SubtitleImage::SubtitleImage (AVSubtitleRect const * rect) for (int y = 0; y < rect->h; ++y) { uint8_t* sub_line_p = sub_p; + uint32_t* out_line_p = out_p; for (int x = 0; x < rect->w; ++x) { - *out_p++ = palette[*sub_line_p++]; + *out_line_p++ = palette[*sub_line_p++]; } sub_p += rect->pict.linesize[0]; + out_p += _image->stride()[0] / sizeof (uint32_t); } } |
