Index: libs/libmythtv/avformatdecoder.cpp
===================================================================
--- libs/libmythtv/avformatdecoder.cpp	(revision 11310)
+++ libs/libmythtv/avformatdecoder.cpp	(working copy)
@@ -2954,6 +2954,24 @@
                         DecodeDTVCC(mpa_pic.atsc_cc_buf + i);
                     }
 
+                    // Decode DVB captions from MPEG user data
+                    if (mpa_pic.dvb_cc_len > 0) {
+                        unsigned long long utc = lastccptsu;
+
+                        for (uint i = 0; i < (uint)mpa_pic.dvb_cc_len; i += 2) {
+                            uint8_t cc_lo = mpa_pic.dvb_cc_data[i];
+                            uint8_t cc_hi = mpa_pic.dvb_cc_data[i+1];
+
+                            uint16_t cc_dt = (cc_hi << 8) | cc_lo;
+
+                            if (cc608_good_parity(cc608_parity_table, cc_dt)) {
+                                ccd608->FormatCCField(utc/1000, 0, cc_dt);
+                                utc += 33367;
+                            }
+                        }
+                        lastccptsu = utc;
+                    }
+
                     VideoFrame *picframe = (VideoFrame *)(mpa_pic.opaque);
 
                     if (!directrendering)
Index: libs/libavcodec/mpegvideo.c
===================================================================
--- libs/libavcodec/mpegvideo.c	(revision 11310)
+++ libs/libavcodec/mpegvideo.c	(working copy)
@@ -1548,6 +1548,11 @@
         pic->atsc_cc_len = s->tmp_atsc_cc_len;
         s->tmp_atsc_cc_len = 0;
 
+        /* Put DVB captions cached from parse_user_data into the correct frame */
+        memcpy(pic->dvb_cc_data, s->tmp_dvb_cc_data, s->tmp_dvb_cc_len);
+        pic->dvb_cc_len = s->tmp_dvb_cc_len;
+        s->tmp_dvb_cc_len = 0;
+
         pic->reference= (s->pict_type != B_TYPE || s->codec_id == CODEC_ID_H264)
                         && !s->dropable ? 3 : 0;
 
Index: libs/libavcodec/mpegvideo.h
===================================================================
--- libs/libavcodec/mpegvideo.h	(revision 11310)
+++ libs/libavcodec/mpegvideo.h	(working copy)
@@ -707,6 +707,13 @@
     uint8_t tmp_atsc_cc_buf[ATSC_CC_BUF_SIZE];
     int     tmp_atsc_cc_len;
 
+#define DVB_CC_BUF_SIZE 32
+    /// Used to hold cached user_data about certain types of DVB captions
+    uint8_t tmp_dvb_cc_data[DVB_CC_BUF_SIZE];
+    int     tmp_dvb_cc_len;
+    uint8_t tmp_dvb_p_buf[DVB_CC_BUF_SIZE];
+    int     tmp_dvb_p_len;
+
     int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch()
 #define SLICE_OK         0
 #define SLICE_ERROR     -1
Index: libs/libavcodec/mpeg12.c
===================================================================
--- libs/libavcodec/mpeg12.c	(revision 11310)
+++ libs/libavcodec/mpeg12.c	(working copy)
@@ -3014,6 +3014,94 @@
         else if (user_data_type_code == 0x06) {
             // bar data (letterboxing info)
         }
+    } else if (len >= 11 &&
+               p[0] == 0x05 && p[1] == 0x02) {
+        p += 2;
+        len -= 2;
+
+        Mpeg1Context   *s1 = avctx->priv_data;
+        MpegEncContext *s  = &s1->mpeg_enc_ctx;
+
+        uint8_t dvb_cc_type = p[5];
+
+        p += 6;
+        len -= 6;
+
+        if (dvb_cc_type == 0x02) { /* 2-byte caption, can be repeated */
+            uint8_t hi = p[1];
+            uint8_t lo = p[2];
+
+            dvb_cc_type = p[3];
+
+            if ((2 <= len) && ((2 + s->tmp_dvb_cc_len) < DVB_CC_BUF_SIZE)) {
+                s->tmp_dvb_cc_data[s->tmp_dvb_cc_len++] = hi;
+                s->tmp_dvb_cc_data[s->tmp_dvb_cc_len++] = lo;
+
+                /* Only repeat characters when the next type flag
+                 * is 0x04 and the characters are repeatable (i.e., less than
+                 * 32 with the parity stripped).
+                 */
+                if (dvb_cc_type == 0x04 && (hi & 0x7f) < 32) {
+                    if ((4 <= len) &&
+                        ((4 + s->tmp_dvb_cc_len) < DVB_CC_BUF_SIZE)) {
+                        s->tmp_dvb_cc_data[s->tmp_dvb_cc_len++] = hi;
+                        s->tmp_dvb_cc_data[s->tmp_dvb_cc_len++] = lo;
+                    }
+                }
+            }
+
+            p += 6;
+            len -= 6;
+        } else if (dvb_cc_type == 0x04) { /* 4-byte caption, not repeated */
+            if ((4 <= len) && ((4 + s->tmp_dvb_cc_len) < DVB_CC_BUF_SIZE)) {
+                s->tmp_dvb_cc_data[s->tmp_dvb_cc_len++] = p[1];
+                s->tmp_dvb_cc_data[s->tmp_dvb_cc_len++] = p[2];
+                s->tmp_dvb_cc_data[s->tmp_dvb_cc_len++] = p[3];
+                s->tmp_dvb_cc_data[s->tmp_dvb_cc_len++] = p[4];
+            }
+
+            p += 9;
+            len -= 9;
+        } else if (dvb_cc_type == 0x05) {
+            /* Buffered prediction frame captions */
+            if (s->tmp_dvb_p_len > 0) {
+                int i;
+                for (i = 0; i < s->tmp_dvb_p_len; i++) {
+                    s->tmp_dvb_cc_data[s->tmp_dvb_cc_len++] = 
+                        s->tmp_dvb_p_buf[i];
+                }
+                s->tmp_dvb_p_len = 0;
+            }
+
+            dvb_cc_type = p[6];
+
+            uint8_t hi = p[8];
+            uint8_t lo = p[9];
+
+            s->tmp_dvb_p_buf[s->tmp_dvb_p_len++] = hi;
+            s->tmp_dvb_p_buf[s->tmp_dvb_p_len++] = lo;
+
+            /* If it's type 0x02 it can be repeated according to rules
+             * detailed in the above comment.
+             */
+            if ((dvb_cc_type == 0x02) &&
+                ((s->tmp_dvb_p_len + 2) < DVB_CC_BUF_SIZE)) {
+                dvb_cc_type = p[10];
+                if ((dvb_cc_type == 0x04) && ((hi & 0x7f) < 32) &&
+                    ((s->tmp_dvb_p_len + 4) < DVB_CC_BUF_SIZE)) {
+                    s->tmp_dvb_p_buf[s->tmp_dvb_p_len++] = hi;
+                    s->tmp_dvb_p_buf[s->tmp_dvb_p_len++] = lo;
+                }
+            } else if ((s->tmp_dvb_p_len + 4) < DVB_CC_BUF_SIZE) {
+                s->tmp_dvb_p_buf[s->tmp_dvb_p_len++] = p[10];
+                s->tmp_dvb_p_buf[s->tmp_dvb_p_len++] = p[11];
+                p += 2;
+                len -= 2;
+            }
+
+            p += 11;
+            len -= 11;
+        }
     }
 }
 
Index: libs/libavcodec/avcodec.h
===================================================================
--- libs/libavcodec/avcodec.h	(revision 11310)
+++ libs/libavcodec/avcodec.h	(working copy)
@@ -667,6 +667,13 @@
     uint8_t atsc_cc_buf[1024];\
     int atsc_cc_len;\
 \
+    /** DVB CC data\
+     * - encoding: unused\
+     * - decoding: set by lavc\
+     */\
+    uint8_t dvb_cc_data[1024];\
+    int dvb_cc_len;\
+\
 
 #define FF_QSCALE_TYPE_MPEG1 0
 #define FF_QSCALE_TYPE_MPEG2 1
