summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-25 16:36:49 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-25 16:36:57 +0100
commit0b980e57ace0acf74bee8bcfc89cbd4f0ff2a602 (patch)
tree4c686815658def8f07e78a8c9bf2d7ec7b2f33be
parent8b6b3632fea26b2fedfb3fc4937b0835b559ec45 (diff)
parentcf0c63d99ae47b838b439f365994e599d056b351 (diff)
Merge remote-tracking branch 'cus/stable'
* cus/stable: ffplay: fix greenish line on the right edge with some xv sizes Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--ffplay.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ffplay.c b/ffplay.c
index b69b503692..38673b5de1 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1478,6 +1478,24 @@ static void alloc_picture(VideoState *is)
SDL_UnlockMutex(is->pictq_mutex);
}
+static void duplicate_right_border_pixels(SDL_Overlay *bmp) {
+ int i, width, height;
+ Uint8 *p, *maxp;
+ for (i = 0; i < 3; i++) {
+ width = bmp->w;
+ height = bmp->h;
+ if (i > 0) {
+ width >>= 1;
+ height >>= 1;
+ }
+ if (bmp->pitches[i] > width) {
+ maxp = bmp->pixels[i] + bmp->pitches[i] * height - 1;
+ for (p = bmp->pixels[i] + width - 1; p < maxp; p += bmp->pitches[i])
+ *(p+1) = *p;
+ }
+ }
+}
+
static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_t pos, int serial)
{
VideoPicture *vp;
@@ -1593,6 +1611,8 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_
sws_scale(is->img_convert_ctx, src_frame->data, src_frame->linesize,
0, vp->height, pict.data, pict.linesize);
#endif
+ /* workaround SDL PITCH_WORKAROUND */
+ duplicate_right_border_pixels(vp->bmp);
/* update the bitmap content */
SDL_UnlockYUVOverlay(vp->bmp);