changeset 31924:8d7f15885b64

Pass the video dimensions specified in the subtitle to spudec. Makes DVD-resolution PGS subs work correctly.
author reimar
date Sat, 21 Aug 2010 11:54:04 +0000
parents 8c6e90c5fcc4
children 616375aefdda
files av_sub.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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],