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

File 0001b-Ensure-that-DVD-subpictures-that-don-t-explicitly-se.patch, 3.5 KB (added by peper03@…, 8 years ago)
  • mythtv/libs/libmythtv/DVD/dvdringbuffer.cpp

    From f6d62e0c4feb176b73bdf4b3b10785e1b29f58f2 Mon Sep 17 00:00:00 2001
    From: Richard <peper03@yahoo.com>
    Date: Tue, 19 Mar 2013 12:36:21 +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/DVD/mythdvdplayer.cpp |    1 +
     mythtv/libs/libmythtv/subtitlereader.cpp    |    4 ++--
     3 files changed, 13 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/DVD/mythdvdplayer.cpp

    diff --git a/mythtv/libs/libmythtv/DVD/mythdvdplayer.cpp b/mythtv/libs/libmythtv/DVD/mythdvdplayer.cpp
    index 2faf2dd..11a0add 100644
    a b void MythDVDPlayer::DisplayDVDButton(void) 
    529529    }
    530530
    531531    if (dvdSubtitle &&
     532        (dvdSubtitle->end_display_time > dvdSubtitle->start_display_time) &&
    532533        (dvdSubtitle->end_display_time < currentFrame->timecode))
    533534    {
    534535        expired = true;
  • 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();