Ticket #10495: 0006-crc32-of-nothing-is-0-not-1-just-a-guess-based-on-ob.patch

File 0006-crc32-of-nothing-is-0-not-1-just-a-guess-based-on-ob.patch, 1.1 KB (added by dekarl@…, 12 years ago)

Fix 0 != 0xffffffff, I'm not sure which way around its actually right, but this way I don't get errors

  • mythtv/libs/libmythtv/mpeg/pespacket.cpp

    From bf57d03c0f133f9ade5909f147ea7b32ddf2e135 Mon Sep 17 00:00:00 2001
    From: Karl Dietz <dekarl@users.sourceforge.net>
    Date: Mon, 26 Mar 2012 19:13:21 +0200
    Subject: [PATCH 6/6] crc32 of nothing is 0, not -1 (just a guess based on observation and discussions)
    
    ---
     mythtv/libs/libmythtv/mpeg/pespacket.cpp |    5 ++++-
     1 files changed, 4 insertions(+), 1 deletions(-)
    
    diff --git a/mythtv/libs/libmythtv/mpeg/pespacket.cpp b/mythtv/libs/libmythtv/mpeg/pespacket.cpp
    index 4df52da..e2f1cd7 100644
    a b void PESPacket::GetAsTSPackets(vector<TSPacket> &output, uint cc) const 
    142142#undef INCR_CC
    143143}
    144144
     145// The CRC should be 0 if everything is ok
     146// From http://forums.dvbowners.com/index.php?showtopic=10773&view=findpost&p=74377
     147// the official specs leave it for you to figure out
    145148uint PESPacket::CalcCRC(void) const
    146149{
    147150    if (Length() < 1)
    148         return 0xffffffff;
     151        return 0;
    149152    return av_bswap32(av_crc(av_crc_get_table(AV_CRC_32_IEEE), (uint32_t) -1,
    150153                             _pesdata, Length() - 1));
    151154}