summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2009-01-03 17:50:00 +0000
committerMichael Niedermayer <michaelni@gmx.at>2009-01-03 17:50:00 +0000
commit7cf9c6ae40181f2d769ce73bf141c445f036f30c (patch)
treed9db8b56fbae4fe5127c261d9f1fabc12d871bc1 /ffplay.c
parentc66216ed5d3ba252b794aee10e6dba01a020bcda (diff)
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) Originally committed as revision 16411 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ffplay.c b/ffplay.c
index a802cc1483..69b1fa1d83 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -441,10 +441,10 @@ static void blend_subrect(AVPicture *dst, const AVSubtitleRect *rect, int imgw,
const uint32_t *pal;
int dstx, dsty, dstw, dsth;
- dstx = FFMIN(FFMAX(rect->x, 0), imgw);
- dstw = FFMIN(FFMAX(rect->w, 0), imgw - dstx);
- dsty = FFMIN(FFMAX(rect->y, 0), imgh);
- dsth = FFMIN(FFMAX(rect->h, 0), imgh - dsty);
+ dstw = av_clip(rect->w, 0, imgw);
+ dsth = av_clip(rect->h, 0, imgh);
+ dstx = av_clip(rect->x, 0, imgw - dstw);
+ dsty = av_clip(rect->y, 0, imgh - dsth);
lum = dst->data[0] + dsty * dst->linesize[0];
cb = dst->data[1] + (dsty >> 1) * dst->linesize[1];
cr = dst->data[2] + (dsty >> 1) * dst->linesize[2];