Commit 03af2c4f authored by michael's avatar michael

Display subtitles within the display area.

Fixes dvd-subtitle-problem.vob. (problem likely is that the video
resolution is smaller than what the subtitles expect)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16411 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1f2c83d3
...@@ -441,10 +441,10 @@ static void blend_subrect(AVPicture *dst, const AVSubtitleRect *rect, int imgw, ...@@ -441,10 +441,10 @@ static void blend_subrect(AVPicture *dst, const AVSubtitleRect *rect, int imgw,
const uint32_t *pal; const uint32_t *pal;
int dstx, dsty, dstw, dsth; int dstx, dsty, dstw, dsth;
dstx = FFMIN(FFMAX(rect->x, 0), imgw); dstw = av_clip(rect->w, 0, imgw);
dstw = FFMIN(FFMAX(rect->w, 0), imgw - dstx); dsth = av_clip(rect->h, 0, imgh);
dsty = FFMIN(FFMAX(rect->y, 0), imgh); dstx = av_clip(rect->x, 0, imgw - dstw);
dsth = FFMIN(FFMAX(rect->h, 0), imgh - dsty); dsty = av_clip(rect->y, 0, imgh - dsth);
lum = dst->data[0] + dsty * dst->linesize[0]; lum = dst->data[0] + dsty * dst->linesize[0];
cb = dst->data[1] + (dsty >> 1) * dst->linesize[1]; cb = dst->data[1] + (dsty >> 1) * dst->linesize[1];
cr = dst->data[2] + (dsty >> 1) * dst->linesize[2]; cr = dst->data[2] + (dsty >> 1) * dst->linesize[2];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment