# HG changeset patch # User reimar # Date 1282391644 0 # Node ID 8d7f15885b64e03b0621333a6afbe4b706ff9d57 # Parent 8c6e90c5fcc4867b9dda1ab1e364ed961a865e5e Pass the video dimensions specified in the subtitle to spudec. Makes DVD-resolution PGS subs work correctly. diff -r 8c6e90c5fcc4 -r 8d7f15885b64 av_sub.c --- a/av_sub.c Sat Aug 21 11:36:18 2010 +0000 +++ b/av_sub.c Sat Aug 21 11:54:04 2010 +0000 @@ -38,7 +38,6 @@ { AVCodecContext *ctx = sh->context; enum CodecID cid = CODEC_ID_NONE; - int srcw = 0, srch = 0; int new_type = 0; int res; int got_sub; @@ -49,7 +48,6 @@ case 'b': cid = CODEC_ID_DVB_SUBTITLE; break; case 'p': - srcw = 1920; srch = 1080; cid = CODEC_ID_HDMV_PGS_SUBTITLE; break; case 'x': cid = CODEC_ID_XSUB; break; @@ -86,7 +84,7 @@ switch (sub.rects[0]->type) { case SUBTITLE_BITMAP: if (!vo_spudec) - vo_spudec = spudec_new_scaled(NULL, srcw, srch, NULL, 0); + vo_spudec = spudec_new_scaled(NULL, ctx->width, ctx->height, NULL, 0); spudec_set_paletted(vo_spudec, sub.rects[0]->pict.data[0], sub.rects[0]->pict.linesize[0],