Ticket #9549: 0001-Make-MPEG2fixup-ProcessVideo-return-int.patch

File 0001-Make-MPEG2fixup-ProcessVideo-return-int.patch, 1.9 KB (added by beirdo, 9 years ago)
  • mythtv/programs/mythtranscode/mpeg2fix.cpp

    From fd15cb59b10e305df20c4661850a7fc5e98b6bd4 Mon Sep 17 00:00:00 2001
    From: Gavin Hurlbut <ghurlbut@mythtv.org>
    Date: Thu, 17 Feb 2011 18:42:15 -0800
    Subject: [PATCH] Make MPEG2fixup::ProcessVideo return int
    
    I'm not 100% sure what the original author was trying to do here, but this
    code is broken.  Returning 0, 1, -1 for a bool makes no sense, and comparing
    bool < 0 makes even less sense.  Rather than trying to unravel what he was
    trying to do, let's make this a simple int return so the return codes should
    have some effect.
    
    Fixes #9549
    ---
     mythtv/programs/mythtranscode/mpeg2fix.cpp |    2 +-
     mythtv/programs/mythtranscode/mpeg2fix.h   |    2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/mythtv/programs/mythtranscode/mpeg2fix.cpp b/mythtv/programs/mythtranscode/mpeg2fix.cpp
    index 8bb8767..255291f 100644
    a b void MPEG2fixup::AddSequence(MPEG2frame *frame1, MPEG2frame *frame2) 
    822822    }
    823823}
    824824
    825 bool MPEG2fixup::ProcessVideo(MPEG2frame *vf, mpeg2dec_t *dec)
     825int MPEG2fixup::ProcessVideo(MPEG2frame *vf, mpeg2dec_t *dec)
    826826{
    827827    int state = -1;
    828828    int last_pos = 0;
  • mythtv/programs/mythtranscode/mpeg2fix.h

    diff --git a/mythtv/programs/mythtranscode/mpeg2fix.h b/mythtv/programs/mythtranscode/mpeg2fix.h
    index 73260c3..44c703e 100644
    a b class MPEG2fixup 
    172172    int AddFrame(MPEG2frame *f);
    173173    int InitAV(const char *inputfile, const char *type, int64_t offset);
    174174    void ScanAudio();
    175     bool ProcessVideo(MPEG2frame *vf, mpeg2dec_t *dec);
     175    int ProcessVideo(MPEG2frame *vf, mpeg2dec_t *dec);
    176176    void WriteFrame(const char *filename, MPEG2frame *f);
    177177    void WriteFrame(const char *filename, AVPacket *pkt);
    178178    void WriteYUV(const char *filename, const mpeg2_info_t *info);