[FFmpeg-cvslog] r16411 - trunk/ffplay.c
michael
subversion
Sat Jan 3 18:50:00 CET 2009
Author: michael
Date: Sat Jan 3 18:50:00 2009
New Revision: 16411
Log:
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)
Modified:
trunk/ffplay.c
Modified: trunk/ffplay.c
==============================================================================
--- trunk/ffplay.c Sat Jan 3 16:15:03 2009 (r16410)
+++ trunk/ffplay.c Sat Jan 3 18:50:00 2009 (r16411)
@@ -441,10 +441,10 @@ static void blend_subrect(AVPicture *dst
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];
More information about the ffmpeg-cvslog
mailing list