Index: libs/libmythtv/NuppelVideoPlayer.cpp
===================================================================
--- libs/libmythtv/NuppelVideoPlayer.cpp	(revision 24237)
+++ libs/libmythtv/NuppelVideoPlayer.cpp	(working copy)
@@ -7104,11 +7104,12 @@
             {
                 // AVSubtitleRect's image data's not guaranteed to be 4 byte
                 // aligned.
-
-                QRect qrect(rect->x, rect->y, rect->w, rect->h);
-                QRect scaled = videoOutput->GetImageRect(qrect);
-
-                QImage qImage(rect->w, rect->h, QImage::Format_ARGB32);
+                QSize img_size(rect->w, rect->h);
+                QRect img_rect(rect->x, rect->y, rect->w, rect->h);
+                QRect display(rect->display_x, rect->display_y,
+                              rect->display_w, rect->display_h);
+                QRect scaled = videoOutput->GetImageRect(img_rect, &display);
+                QImage qImage(img_size, QImage::Format_ARGB32);
                 for (int y = 0; y < rect->h; ++y)
                 {
                     for (int x = 0; x < rect->w; ++x)
@@ -7120,7 +7121,7 @@
                 }
 
 
-                if (scaled.size() != qrect.size())
+                if (scaled.size() != img_size)
                 {
                     qImage = qImage.scaled(scaled.width(), scaled.height(),
                              Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
Index: libs/libmythtv/videooutbase.cpp
===================================================================
--- libs/libmythtv/videooutbase.cpp	(revision 24237)
+++ libs/libmythtv/videooutbase.cpp	(working copy)
@@ -1399,9 +1399,8 @@
 */
 }
 
-QRect VideoOutput::GetImageRect(const QRect &rect)
+QRect VideoOutput::GetImageRect(const QRect &rect, QRect *display)
 {
-    QRect result = rect;
     float hscale, vscale, tmp;
     tmp = 0.0;
     QRect visible_osd  = GetVisibleOSDBounds(tmp, tmp, tmp);
@@ -1413,6 +1412,17 @@
     float pixel_aspect = (float)video_size.width() /
                          (float)video_size.height();
 
+    QRect rect1 = rect;
+    if (display && display->isValid())
+    {
+        QMatrix m0;
+        m0.scale((float)image_width  / (float)display->width(),
+                 (float)image_height / (float)display->height());
+        rect1 = m0.mapRect(rect1);
+        rect1.translate(display->left(), display->top());
+    }
+    QRect result = rect1;
+
     if (hasFullScreenOSD())
     {
         QRect dvr_rec = windows[0].GetDisplayVideoRect();
@@ -1445,8 +1455,8 @@
     hscale = pixel_aspect / image_aspect;
     if (hscale < 0.99f || hscale > 1.01f)
     {
-        result.setLeft((int)(((float)rect.left() * hscale) + 0.5f));
-        result.setWidth((int)(((float)rect.width() * hscale) + 0.5f));
+        result.setLeft((int)(((float)rect1.left() * hscale) + 0.5f));
+        result.setWidth((int)(((float)rect1.width() * hscale) + 0.5f));
     }
 
     result.translate(-visible_osd.left(), -visible_osd.top());
Index: libs/libmythtv/videooutbase.h
===================================================================
--- libs/libmythtv/videooutbase.h	(revision 24237)
+++ libs/libmythtv/videooutbase.h	(working copy)
@@ -244,7 +244,7 @@
 
     QString GetFilters(void) const;
     /// \brief translates caption/dvd button rectangle into 'screen' space
-    QRect   GetImageRect(const QRect &rect);
+    QRect   GetImageRect(const QRect &rect, QRect *display = NULL);
 
   protected:
     void InitBuffers(int numdecode, bool extra_for_pause, int need_free,
Index: libs/libavcodec/dvbsubdec.c
===================================================================
--- libs/libavcodec/dvbsubdec.c	(revision 24237)
+++ libs/libavcodec/dvbsubdec.c	(working copy)
@@ -22,16 +22,18 @@
 #include "dsputil.h"
 #include "get_bits.h"
 #include "colorspace.h"
+#include "bytestream.h"
 
 //#define DEBUG
 //#define DEBUG_PACKET_CONTENTS
 //#define DEBUG_SAVE_IMAGES
 
-#define DVBSUB_PAGE_SEGMENT     0x10
-#define DVBSUB_REGION_SEGMENT   0x11
-#define DVBSUB_CLUT_SEGMENT     0x12
-#define DVBSUB_OBJECT_SEGMENT   0x13
-#define DVBSUB_DISPLAY_SEGMENT  0x80
+#define DVBSUB_PAGE_SEGMENT              0x10
+#define DVBSUB_REGION_SEGMENT            0x11
+#define DVBSUB_CLUT_SEGMENT              0x12
+#define DVBSUB_OBJECT_SEGMENT            0x13
+#define DVBSUB_DISPLAYDEFINITION_SEGMENT 0x14
+#define DVBSUB_DISPLAY_SEGMENT           0x80
 
 #define cm (ff_cropTbl + MAX_NEG_CROP)
 
@@ -216,6 +218,15 @@
     struct DVBSubRegion *next;
 } DVBSubRegion;
 
+typedef struct DVBSubDisplayDefinition {
+    int version;
+
+    int x;
+    int y;
+    int width;
+    int height;
+} DVBSubDisplayDefinition;
+
 typedef struct DVBSubContext {
     int composition_id;
     int ancillary_id;
@@ -227,6 +238,7 @@
 
     int display_list_size;
     DVBSubRegionDisplay *display_list;
+    DVBSubDisplayDefinition *display_definition;
 } DVBSubContext;
 
 
@@ -334,6 +346,9 @@
         av_free(clut);
     }
 
+    if (ctx->display_definition)
+        av_free(ctx->display_definition);
+
     /* Should already be null */
     if (ctx->object_list)
         av_log(0, AV_LOG_ERROR, "Memory deallocation error!\n");
@@ -1274,10 +1289,51 @@
 }
 #endif
 
+static void dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
+                                                    const uint8_t *buf,
+                                                    int buf_size)
+{
+    DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
+    DVBSubDisplayDefinition *display_def = ctx->display_definition;
+    int dds_version, window_max_x, window_max_y, info_byte;
+
+    if (buf_size < 5)
+        return;
+
+    info_byte   = bytestream_get_byte(&buf);
+    dds_version = (info_byte >> 4) & 0xF;
+    if (display_def && (display_def->version == dds_version))
+        return; // already have this display definition version
+
+    if (!display_def) {
+        ctx->display_definition = av_mallocz(sizeof(DVBSubDisplayDefinition));
+        display_def = ctx->display_definition;
+    }
+
+    display_def->version = dds_version;
+    display_def->x       = 0;
+    display_def->y       = 0;
+    display_def->width   = bytestream_get_be16(&buf) + 1;
+    display_def->height  = bytestream_get_be16(&buf) + 1;
+
+    if (buf_size < 13)
+        return;
+
+    if ((info_byte >> 3) & 1) { // window definition
+        display_def->x = bytestream_get_be16(&buf);
+        display_def->y = bytestream_get_be16(&buf);
+        window_max_x   = bytestream_get_be16(&buf);
+        window_max_y   = bytestream_get_be16(&buf);
+        display_def->width  = window_max_x - display_def->x;
+        display_def->height = window_max_y - display_def->y;
+    }
+}
+
 static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
                                         int buf_size, AVSubtitle *sub)
 {
     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
+    DVBSubDisplayDefinition *display_def = ctx->display_definition;
 
     DVBSubRegion *region;
     DVBSubRegionDisplay *display;
@@ -1316,6 +1372,17 @@
         rect->type      = SUBTITLE_BITMAP;
         rect->pict.linesize[0] = region->width;
 
+        if (display_def) {
+            rect->display_x = display_def->x;
+            rect->display_y = display_def->y;
+            rect->display_w = display_def->width;
+            rect->display_h = display_def->height;
+        }
+        else {
+            rect->display_w = 720;
+            rect->display_h = 576;
+        }
+
         clut = get_clut(ctx, region->clut);
 
         if (!clut)
@@ -1409,6 +1476,8 @@
             case DVBSUB_OBJECT_SEGMENT:
                 dvbsub_parse_object_segment(avctx, p, segment_length);
                 break;
+            case DVBSUB_DISPLAYDEFINITION_SEGMENT:
+                dvbsub_parse_display_definition_segment(avctx, p, segment_length);
             case DVBSUB_DISPLAY_SEGMENT:
                 *data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub);
                 break;
Index: libs/libavcodec/avcodec.h
===================================================================
--- libs/libavcodec/avcodec.h	(revision 24237)
+++ libs/libavcodec/avcodec.h	(working copy)
@@ -2827,6 +2827,10 @@
     int w;         ///< width            of pict, undefined when pict is not set
     int h;         ///< height           of pict, undefined when pict is not set
     int nb_colors; ///< number of colors in pict, undefined when pict is not set
+    int display_x; ///< top left corner of region into which pict is displayed
+    int display_y; ///< top left corner of region into which pict is displayed
+    int display_w; ///< width           of region into which pict is displayed
+    int display_h; ///< height          of region into which pict is displayed
 
     /**
      * data+linesize for the bitmap of this subtitle.
