Ticket #11455: 0001a-Ensure-that-DVD-subpictures-that-don-t-explicitly-se.patch

File 0001a-Ensure-that-DVD-subpictures-that-don-t-explicitly-se.patch, 3.0 KB (added by peper03@…, 8 years ago)

Updated patch

  • mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp

    From 1796e39d5eac930d08b468ceee5d7df84e53ee3a Mon Sep 17 00:00:00 2001
    From: Richard <peper03@yahoo.com>
    Date: Thu, 14 Mar 2013 13:50:18 +0100
    Subject: [PATCH] Ensure that DVD subpictures that don't explicitly set the
     'end' time are still shown, and that sufficient buffering
     is available for full-speed animation in subpictures. Also,
     handle 'CHG_COLCON' command by skipping over the data. 
     This should prevent any issues caused by incorrectly
     interpreting the data as subpicture commands.
    
    ---
     mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp |   14 ++++++++++----
     mythtv/libs/libmythtv/subtitlereader.cpp    |    4 ++--
     2 files changed, 12 insertions(+), 6 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp b/mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp
    index a7ef500..7ffcad6 100644
    a b bool DVDRingBuffer::DecodeSubtitles(AVSubtitle *sub, int *gotSubtitles, 
    13311331    bool force_subtitle_display = false;
    13321332    sub->rects = NULL;
    13331333    sub->num_rects = 0;
    1334     sub->start_display_time = 0;
    1335     sub->end_display_time = 0;
     1334    sub->start_display_time = startTime;
     1335    sub->end_display_time = startTime;
    13361336
    13371337    cmd_pos = GETBE16(spu_pkt + 2);
    13381338    while ((cmd_pos + 4) < buf_size)
    bool DVDRingBuffer::DecodeSubtitles(AVSubtitle *sub, int *gotSubtitles, 
    13501350            {
    13511351                case 0x00:
    13521352                    force_subtitle_display = true;
    1353                     sub->start_display_time = startTime;
    1354                     sub->end_display_time   = 0xFFFFFFFF;
    13551353                break;
    13561354                case 0x01:
    13571355                    sub->start_display_time = ((date << 10) / 90) + startTime;
    bool DVDRingBuffer::DecodeSubtitles(AVSubtitle *sub, int *gotSubtitles, 
    14021400                    pos +=4;
    14031401                }
    14041402                break;
     1403                case 0x07:
     1404                {
     1405                    if ((buf_size - pos) < 2)
     1406                        goto fail;
     1407
     1408                    pos += GETBE16(spu_pkt + pos);
     1409                }
     1410                break;
    14051411                case 0xff:
    14061412                default:
    14071413                goto the_end;
  • mythtv/libs/libmythtv/subtitlereader.cpp

    diff --git a/mythtv/libs/libmythtv/subtitlereader.cpp b/mythtv/libs/libmythtv/subtitlereader.cpp
    index ba43df5..ef820b7 100644
    a b bool SubtitleReader::AddAVSubtitle(const AVSubtitle &subtitle, 
    6060    m_AVSubtitles.buffers.push_back(subtitle);
    6161    // in case forced subtitles aren't displayed, avoid leaking by
    6262    // manually clearing the subtitles
    63     if (m_AVSubtitles.buffers.size() > 20)
     63    if (m_AVSubtitles.buffers.size() > 40)
    6464    {
    6565        LOG(VB_GENERAL, LOG_ERR,
    66             "SubtitleReader: >20 AVSubtitles queued - clearing.");
     66            "SubtitleReader: >40 AVSubtitles queued - clearing.");
    6767        clearsubs = true;
    6868    }
    6969    m_AVSubtitles.lock.unlock();