Ticket #10863: 0001-transcode-Tolerate-mpeg-errors-when-re-encoding-to-I.patch

File 0001-transcode-Tolerate-mpeg-errors-when-re-encoding-to-I.patch, 1.4 KB (added by Lawrence Rust <lvr@…>, 12 years ago)
  • mythtv/programs/mythtranscode/mpeg2fix.cpp

    From dac291a65b06c6cd12a4d537e01b76c2ca899936 Mon Sep 17 00:00:00 2001
    From: Lawrence Rust <lvr@softsystem.co.uk>
    Date: Sat, 23 Jun 2012 18:31:53 +0200
    Subject: [PATCH] transcode: Tolerate mpeg errors when re-encoding to I-frames around cut points
    
    If a recording has a cutlist and is transcoded using that cutlist then
    if there are MPEG decoding errors around the cut point the process of
    re-coding to I frames can fail and the whole transcoding fails.
    
    This patch makes the function MPEG2fixup::ConvertToI tolerant to
    decoding errors and just skips the offending frames.
    
    Signed-off-by: Lawrence Rust <lvr@softsystem.co.uk>
    ---
     mythtv/programs/mythtranscode/mpeg2fix.cpp |    6 +++++-
     1 files changed, 5 insertions(+), 1 deletions(-)
    
    diff --git a/mythtv/programs/mythtranscode/mpeg2fix.cpp b/mythtv/programs/mythtranscode/mpeg2fix.cpp
    index 520179b..f5685ba 100644
    a b int MPEG2fixup::ConvertToI(FrameList *orderedFrames, int headPos) 
    16551655    {
    16561656        int i = GetFrameNum((*it));
    16571657        if ((spare = DecodeToFrame(i, headPos == 0)) == NULL)
    1658             return 1;
     1658        {
     1659            LOG(VB_GENERAL, LOG_WARNING,
     1660                QString("ConvertToI skipping undecoded frame #%1").arg(i));
     1661            continue;
     1662        }
    16591663
    16601664        if (GetFrameTypeT(spare) == 'I')
    16611665            continue;