SOURCES: mythtv-ffmpeg-API.patch (NEW) - new ffmpeg API support

shadzik shadzik at pld-linux.org
Tue Oct 7 16:58:25 CEST 2008


Author: shadzik                      Date: Tue Oct  7 14:58:25 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- new ffmpeg API support

---- Files affected:
SOURCES:
   mythtv-ffmpeg-API.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/mythtv-ffmpeg-API.patch
diff -u /dev/null SOURCES/mythtv-ffmpeg-API.patch:1.1
--- /dev/null	Tue Oct  7 16:58:25 2008
+++ SOURCES/mythtv-ffmpeg-API.patch	Tue Oct  7 16:58:19 2008
@@ -0,0 +1,4538 @@
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/atscdescriptors.h mythtv-0.22-20081007/libs/libmythtv/mpeg/atscdescriptors.h
+--- mythtv-0.21/libs/libmythtv/mpeg/atscdescriptors.h	2006-08-10 22:58:51.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/atscdescriptors.h	2008-10-07 13:51:19.000000000 +0000
+@@ -7,10 +7,9 @@
+ #include <vector>
+ using namespace std;
+ 
+-#include <qstring.h>
+-#include <qmap.h>
++#include <QString>
++#include <QMap>
+ 
+-#include "mythcontext.h"
+ #include "mpegdescriptors.h"
+ 
+ using namespace std;
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/atsc_huffman.cpp mythtv-0.22-20081007/libs/libmythtv/mpeg/atsc_huffman.cpp
+--- mythtv-0.21/libs/libmythtv/mpeg/atsc_huffman.cpp	2006-02-21 15:27:11.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/atsc_huffman.cpp	2008-10-07 13:51:19.000000000 +0000
+@@ -72,7 +72,7 @@
+                 for (int i = 0 ; i < 7 ; i++)
+                 {
+                     val2 |=
+-                        huffman1_get_bit(compressed, bit + i + 2) << 6 - i;
++                        huffman1_get_bit(compressed, bit + i + 2) << (6 - i);
+                 }
+                 retval += QChar(val2);
+                 bit += 8;
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/atscstreamdata.cpp mythtv-0.22-20081007/libs/libmythtv/mpeg/atscstreamdata.cpp
+--- mythtv-0.21/libs/libmythtv/mpeg/atscstreamdata.cpp	2007-04-23 19:37:33.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/atscstreamdata.cpp	2008-10-07 13:51:19.000000000 +0000
+@@ -56,8 +56,8 @@
+ {
+     bool reset = true;
+     const MasterGuideTable *mgt = GetCachedMGT();
+-    tvct_vec_t tvcts = GetAllCachedTVCTs();
+-    cvct_vec_t cvcts = GetAllCachedCVCTs();
++    tvct_vec_t tvcts = GetCachedTVCTs();
++    cvct_vec_t cvcts = GetCachedCVCTs();
+ 
+     if (mgt && (tvcts.size() || cvcts.size()))
+     {
+@@ -523,7 +523,7 @@
+     bool hasit = false;
+ 
+     {
+-        tvct_vec_t tvct = GetAllCachedTVCTs();
++        tvct_vec_t tvct = GetCachedTVCTs();
+         for (uint i = 0; i < tvct.size() && !hasit; i++)
+         {
+             if (tvct[i]->Find(major, minor) >= 0)
+@@ -534,7 +534,7 @@
+ 
+     if (!hasit)
+     {
+-        cvct_vec_t cvct = GetAllCachedCVCTs();
++        cvct_vec_t cvct = GetCachedCVCTs();
+         for (uint i = 0; i < cvct.size() && !hasit; i++)
+         {
+             if (cvct[i]->Find(major, minor) >= 0)
+@@ -612,6 +612,46 @@
+     return ret;
+ }
+ 
++bool ATSCStreamData::HasCachedAnyTVCTs(bool current) const
++{
++    if (!current)
++        VERBOSE(VB_IMPORTANT, "Currently we ignore \'current\' param");
++
++    if (!_cached_mgt)
++        return false;
++
++    _cache_lock.lock();
++    bool ret = false;
++    for (uint i = 0; !ret && (i < _cached_mgt->TableCount()); ++i)
++    {
++        if (TableClass::TVCTc == _cached_mgt->TableClass(i))
++            ret |= HasCachedTVCT(_cached_mgt->TablePID(i));
++    }
++    _cache_lock.unlock();
++
++    return ret;
++}
++
++bool ATSCStreamData::HasCachedAnyCVCTs(bool current) const
++{
++    if (!current)
++        VERBOSE(VB_IMPORTANT, "Currently we ignore \'current\' param");
++
++    if (!_cached_mgt)
++        return false;
++
++    _cache_lock.lock();
++    bool ret = false;
++    for (uint i = 0; !ret && (i < _cached_mgt->TableCount()); ++i)
++    {
++        if (TableClass::CVCTc == _cached_mgt->TableClass(i))
++            ret |= HasCachedCVCT(_cached_mgt->TablePID(i));
++    }
++    _cache_lock.unlock();
++
++    return ret;
++}
++
+ const MasterGuideTable *ATSCStreamData::GetCachedMGT(bool current) const
+ {
+     if (!current)
+@@ -657,7 +697,7 @@
+     return cvct;
+ }
+ 
+-tvct_vec_t ATSCStreamData::GetAllCachedTVCTs(bool current) const
++tvct_vec_t ATSCStreamData::GetCachedTVCTs(bool current) const
+ {
+     if (!current)
+         VERBOSE(VB_IMPORTANT, "Currently we ignore \'current\' param");
+@@ -677,7 +717,7 @@
+     return tvcts;
+ }
+ 
+-cvct_vec_t ATSCStreamData::GetAllCachedCVCTs(bool current) const
++cvct_vec_t ATSCStreamData::GetCachedCVCTs(bool current) const
+ {
+     if (!current)
+         VERBOSE(VB_IMPORTANT, "Currently we ignore \'current\' param");
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/atscstreamdata.h mythtv-0.22-20081007/libs/libmythtv/mpeg/atscstreamdata.h
+--- mythtv-0.21/libs/libmythtv/mpeg/atscstreamdata.h	2006-07-08 22:28:30.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/atscstreamdata.h	2008-10-07 13:51:19.000000000 +0000
+@@ -74,17 +74,23 @@
+     bool HasCachedMGT(bool current = true) const;
+     bool HasCachedTVCT(uint pid, bool current = true) const;
+     bool HasCachedCVCT(uint pid, bool current = true) const;
++
+     bool HasCachedAllTVCTs(bool current = true) const;
+     bool HasCachedAllCVCTs(bool current = true) const;
+-    bool HasCachedAllVCTs(bool current = true) const 
++    bool HasCachedAllVCTs(bool current = true) const
+         { return HasCachedAllTVCTs(current) && HasCachedAllCVCTs(current); }
+ 
++    bool HasCachedAnyTVCTs(bool current = true) const;
++    bool HasCachedAnyCVCTs(bool current = true) const;
++    bool HasCachedAnyVCTs(bool current = true) const
++        { return HasCachedAnyTVCTs(current) || HasCachedAnyCVCTs(current); }
++
+     const MasterGuideTable *GetCachedMGT(bool current = true) const;
+     const tvct_ptr_t        GetCachedTVCT(uint pid, bool current = true) const;
+     const cvct_ptr_t        GetCachedCVCT(uint pid, bool current = true) const;
+ 
+-    tvct_vec_t GetAllCachedTVCTs(bool current = true) const;
+-    cvct_vec_t GetAllCachedCVCTs(bool current = true) const;
++    tvct_vec_t GetCachedTVCTs(bool current = true) const;
++    cvct_vec_t GetCachedCVCTs(bool current = true) const;
+ 
+     void ReturnCachedTVCTTables(tvct_vec_t&) const;
+     void ReturnCachedCVCTTables(cvct_vec_t&) const;
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/atsctables.h mythtv-0.22-20081007/libs/libmythtv/mpeg/atsctables.h
+--- mythtv-0.21/libs/libmythtv/mpeg/atsctables.h	2007-01-08 00:29:53.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/atsctables.h	2008-10-07 13:51:19.000000000 +0000
+@@ -3,10 +3,11 @@
+ #ifndef _ATSC_TABLES_H_
+ #define _ATSC_TABLES_H_
+ 
++#include <stdint.h>  // uint32_t
++#include <QString>
+ #include "mpegtables.h"
+ #include "atscdescriptors.h"
+-#include <qstring.h>
+-#include <stdint.h>  // uint32_t
++#include "libmythdb/mythverbose.h"
+ 
+ // Some sample code is in pcHDTV's dtvscan.c,
+ // accum_sect/dequeue_buf/atsc_tables.  We should stuff
+@@ -66,7 +67,7 @@
+         ETTe    =  7,
+         DCCT    =  8,
+         RRT     =  9,
+-    };
++    } kTableTypes;
+ };
+ 
+ /** \class MasterGuideTable
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/dvbdescriptors.cpp mythtv-0.22-20081007/libs/libmythtv/mpeg/dvbdescriptors.cpp
+--- mythtv-0.21/libs/libmythtv/mpeg/dvbdescriptors.cpp	2007-12-16 18:15:42.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/dvbdescriptors.cpp	2008-10-07 13:51:19.000000000 +0000
+@@ -1,9 +1,12 @@
++#include <unistd.h>
++
++#include <QTextCodec>
++
+ #include "dvbdescriptors.h"
+ #include "iso6937tables.h"
++#include "freesat_huffman.h"
++#include "libmythdb/mythverbose.h"
+ 
+-#include <unistd.h>
+-#include <qtextcodec.h>
+-#include <qdeepcopy.h>
+ 
+ // Only some of the QTextCodec calls are reenterant.
+ // If you use this please verify that you are using a reenterant call.
+@@ -70,6 +73,9 @@
+     if (!raw_length)
+         return "";
+ 
++    if (src[0] == 0x1f)
++        return freesat_huffman_to_string(src, raw_length);
++
+     if ((0x10 < src[0]) && (src[0] < 0x20))
+     {
+         // TODO: Handle multi-byte encodings
+@@ -78,13 +84,16 @@
+         return "";
+     }
+ 
+-    // Strip formatting characters
+-    // Also, if a override encoding is specified copy it in front of the text
++    // if a override encoding is specified and the default ISO 6937 encoding
++    // would be used copy the ovverride encoding in front of the text
+     unsigned char dst[raw_length + encoding_override_length];
+-    uint length = encoding_override_length;
+-    if (encoding_override)
++    uint length = 0;
++    if (encoding_override && src[0] >= 0x20) {
+         memcpy(dst, encoding_override, encoding_override_length);
++        length = encoding_override_length;
++    }
+     
++    // Strip formatting characters
+     for (uint i = 0; i < raw_length; i++)
+     {
+         if ((src[i] < 0x80) || (src[i] > 0x9F))
+@@ -141,7 +150,7 @@
+     if ((category_type > kCategoryNone) && (category_type < kCategoryLast))
+         return QString(cattype[category_type]);
+ 
+-    return QString::null;
++    return QString("");
+ }
+ 
+ MythCategoryType string_to_myth_category_type(const QString &category_type)
+@@ -174,12 +183,20 @@
+     // Try to get detailed description
+     map<uint,QString>::const_iterator it = categoryDesc.find(Nibble(i));
+     if (it != categoryDesc.end())
+-        return QDeepCopy<QString>((*it).second);
++    {
++        QString ret = (*it).second;
++        ret.detach();
++        return ret;
++    }
+ 
+     // Fall back to category description
+     it = categoryDesc.find(Nibble1(i)<<4);
+     if (it != categoryDesc.end())
+-        return QDeepCopy<QString>((*it).second);
++    {
++        QString ret = (*it).second;
++        ret.detach();
++        return ret;
++    }
+ 
+     // Found nothing? Just return empty string.
+     return "";
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/dvbstreamdata.cpp mythtv-0.22-20081007/libs/libmythtv/mpeg/dvbstreamdata.cpp
+--- mythtv-0.21/libs/libmythtv/mpeg/dvbstreamdata.cpp	2008-02-26 23:37:42.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/dvbstreamdata.cpp	2008-10-07 13:51:19.000000000 +0000
+@@ -9,6 +9,7 @@
+ #include "eithelper.h"
+ 
+ #define PREMIERE_ONID 133
++#define FREESAT_EIT_PID 3842
+ 
+ // service_id is synonymous with the MPEG program number in the PMT.
+ DVBStreamData::DVBStreamData(uint desired_netid,  uint desired_tsid,
+@@ -97,7 +98,7 @@
+         return false;
+ 
+     bool is_eit = false;
+-    if (DVB_EIT_PID == pid)
++    if (DVB_EIT_PID == pid || FREESAT_EIT_PID == pid)
+     {
+         // Standard Now/Next Event Information Tables for this transport
+         is_eit |= TableID::PF_EIT  == table_id;
+@@ -130,7 +131,7 @@
+         return SDToSectionSeen(psip.TableIDExtension(), psip.Section());
+     }
+ 
+-    if (DVB_EIT_PID == pid)
++    if (DVB_EIT_PID == pid || FREESAT_EIT_PID == pid)
+     {
+         // Standard Now/Next Event Information Tables for other transport
+         is_eit |= TableID::PF_EITo == table_id;
+@@ -152,8 +153,8 @@
+         return EITSectionSeen(table_id, service_id, psip.Section());
+     }
+ 
+-    if (PREMIERE_EIT_DIREKT_PID == pid || PREMIERE_EIT_SPORT_PID == pid
+-        && TableID::PREMIERE_CIT == table_id)
++    if (((PREMIERE_EIT_DIREKT_PID == pid) || (PREMIERE_EIT_SPORT_PID == pid)) &&
++        TableID::PREMIERE_CIT == table_id)
+     {
+         uint content_id = PremiereContentInformationTable(psip).ContentID();
+         if (VersionCIT(content_id) != version)
+@@ -327,7 +328,7 @@
+         }
+     }
+ 
+-    if ((DVB_EIT_PID == pid || DVB_DNLONG_EIT_PID == pid) &&
++    if ((DVB_EIT_PID == pid || DVB_DNLONG_EIT_PID == pid || FREESAT_EIT_PID == pid) &&
+         DVBEventInformationTable::IsEIT(psip.TableID()))
+     {
+         QMutexLocker locker(&_listener_lock);
+@@ -428,6 +429,12 @@
+         {
+             add_pids.push_back(PREMIERE_EIT_SPORT_PID);
+         }
++
++        if (find(cur_pids.begin(), cur_pids.end(),
++                 (uint) FREESAT_EIT_PID) == cur_pids.end())
++        {
++            add_pids.push_back(FREESAT_EIT_PID);
++        }
+     }
+     else
+     {
+@@ -457,6 +464,12 @@
+         {
+             del_pids.push_back(PREMIERE_EIT_SPORT_PID);
+         }
++
++        if (find(cur_pids.begin(), cur_pids.end(),
++                 (uint) FREESAT_EIT_PID) == cur_pids.end())
++        {
++            del_pids.push_back(FREESAT_EIT_PID);
++        }
+     }
+ 
+     return add_pids.size() || del_pids.size();
+@@ -686,6 +699,26 @@
+     return false;
+ }
+ 
++bool DVBStreamData::HasCachedAnySDTs(bool current) const
++{
++    QMutexLocker locker(&_cache_lock);
++
++    if (_cached_nit.empty())
++        return false;
++
++    nit_cache_t::const_iterator it = _cached_nit.begin();
++    for (; it != _cached_nit.end(); ++it)
++    {
++        for (uint i = 0; i < (*it)->TransportStreamCount(); i++)
++        {
++            if (HasCachedAnySDT((*it)->TSID(i), current))
++                return true;
++        }
++    }
++
++    return false;
++}
++
+ bool DVBStreamData::HasCachedAllSDTs(bool current) const
+ {
+     QMutexLocker locker(&_cache_lock);
+@@ -696,7 +729,7 @@
+     nit_cache_t::const_iterator it = _cached_nit.begin();
+     for (; it != _cached_nit.end(); ++it)
+     {
+-        if ((*it)->TransportStreamCount() > _cached_sdts.size())
++        if ((int)(*it)->TransportStreamCount() > _cached_sdts.size())
+             return false;
+ 
+         for (uint i = 0; i < (*it)->TransportStreamCount(); i++)
+@@ -724,6 +757,22 @@
+     return nit;
+ }
+ 
++const nit_vec_t DVBStreamData::GetCachedNIT(bool current) const
++{
++    QMutexLocker locker(&_cache_lock);
++
++    nit_vec_t nits;
++
++    for (uint i = 0; i < 256; i++)
++    {
++        nit_ptr_t nit = GetCachedNIT(i, current);
++        if (nit)
++            nits.push_back(nit);
++    }
++
++    return nits;
++}
++
+ const sdt_ptr_t DVBStreamData::GetCachedSDT(
+     uint tsid, uint section_num, bool current) const
+ {
+@@ -742,7 +791,7 @@
+     return sdt;
+ }
+ 
+-const sdt_vec_t DVBStreamData::GetAllCachedSDTs(bool current) const
++const sdt_vec_t DVBStreamData::GetCachedSDTs(bool current) const
+ {
+     QMutexLocker locker(&_cache_lock);
+ 
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/dvbstreamdata.h mythtv-0.22-20081007/libs/libmythtv/mpeg/dvbstreamdata.h
+--- mythtv-0.21/libs/libmythtv/mpeg/dvbstreamdata.h	2008-02-26 23:37:42.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/dvbstreamdata.h	2008-10-07 13:51:19.000000000 +0000
+@@ -6,12 +6,13 @@
+ #include "mpegstreamdata.h"
+ 
+ typedef NetworkInformationTable* nit_ptr_t;
+-typedef vector<const nit_ptr_t>  nit_vec_t;
+-typedef QMap<uint, nit_ptr_t>    nit_cache_t;
++typedef vector<const NetworkInformationTable*>  nit_vec_t;
++typedef QMap<uint, nit_ptr_t>    nit_cache_t; // section->sdts
+ 
+ typedef ServiceDescriptionTable* sdt_ptr_t;
+ typedef vector<const ServiceDescriptionTable*>  sdt_vec_t;
+-typedef QMap<uint, sdt_ptr_t>    sdt_cache_t;
++typedef QMap<uint, sdt_ptr_t>    sdt_cache_t; // tsid+section->sdts
++typedef QMap<uint, sdt_vec_t>    sdt_map_t;   // tsid->sdts
+ 
+ typedef vector<DVBMainStreamListener*>   dvb_main_listener_vec_t;
+ typedef vector<DVBOtherStreamListener*>  dvb_other_listener_vec_t;
+@@ -161,12 +162,14 @@
+     bool HasCachedAnySDT(uint tsid, bool current = true) const;
+     bool HasCachedAllSDT(uint tsid, bool current = true) const;
+     bool HasCachedSDT(bool current = true) const;
++    bool HasCachedAnySDTs(bool current = true) const;
+     bool HasCachedAllSDTs(bool current = true) const;
+ 
+     const nit_ptr_t GetCachedNIT(uint section_num, bool current = true) const;
++    const nit_vec_t GetCachedNIT(bool current = true) const;
+     const sdt_ptr_t GetCachedSDT(uint tsid, uint section_num,
+                                  bool current = true) const;
+-    const sdt_vec_t GetAllCachedSDTs(bool current = true) const;
++    const sdt_vec_t GetCachedSDTs(bool current = true) const;
+ 
+     void ReturnCachedSDTTables(sdt_vec_t&) const;
+ 
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/dvbtables.cpp mythtv-0.22-20081007/libs/libmythtv/mpeg/dvbtables.cpp
+--- mythtv-0.21/libs/libmythtv/mpeg/dvbtables.cpp	2007-07-14 16:13:10.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/dvbtables.cpp	2008-10-07 13:51:19.000000000 +0000
+@@ -36,7 +36,7 @@
+ 
+     for (uint i = 0; i < TransportStreamCount(); i++)
+     {
+-        str.append(QString("  Transport #%1 TSID(0x%1) ")
++        str.append(QString("  Transport #%1 TSID(0x%2) ")
+                    .arg(i, 2, 10).arg(TSID(i), 0, 16));
+         str.append(QString("original_network_id(0x%2) desc_len(%3)\n")
+                    .arg(OriginalNetworkID(i), 0, 16)
+@@ -94,7 +94,7 @@
+ {
+     QString str =
+         QString("SDT: TSID(0x%1) original_network_id(0x%2) services(%3)\n")
+-        .arg(OriginalNetworkID(), 0, 16).arg(TSID(), 0, 16)
++        .arg(TSID(), 0, 16).arg(OriginalNetworkID(), 0, 16)
+         .arg(ServiceCount());
+     
+     for (uint i = 0; i < ServiceCount(); i++)
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/freesat_huffman.cpp mythtv-0.22-20081007/libs/libmythtv/mpeg/freesat_huffman.cpp
+--- mythtv-0.21/libs/libmythtv/mpeg/freesat_huffman.cpp	1970-01-01 00:00:00.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/freesat_huffman.cpp	2008-10-07 13:51:19.000000000 +0000
+@@ -0,0 +1,118 @@
++#include "freesat_huffman.h"
++
++#include <qstring.h>
++
++struct hufftab {
++    char last;
++    unsigned int value;
++    short bits;
++    char next;
++};
++
++#define START   '\0'
++#define STOP    '\0'
++#define ESCAPE  '\1'
++
++#include "freesat_tables.h"
++
++QString freesat_huffman_to_string(const unsigned char *src, uint size)
++{
++    if (src[1] == 1 || src[1] == 2)
++    {
++        QByteArray uncompressed(size * 3);
++        int p = 0;
++        struct hufftab *table;
++        unsigned table_length;
++        if (src[1] == 1)
++        {
++            table = fsat_huffman1;
++            table_length = sizeof(fsat_huffman1) / sizeof(fsat_huffman1[0]);
++        }
++        else
++        {
++            table = fsat_huffman2;
++            table_length = sizeof(fsat_huffman2) / sizeof(fsat_huffman2[0]);
++        }
++        unsigned value = 0, byte = 2, bit = 0;
++        while (byte < 6 && byte < size)
++        {
++            value |= src[byte] << ((5-byte) * 8);
++            byte++;
++        }
++        char lastch = START;
++
++        do
++        {
++            bool found = false;
++            unsigned bitShift = 0;
++            if (lastch == ESCAPE)
++            {
++                found = true;
++                // Encoded in the next 8 bits.
++                // Terminated by the first ASCII character.
++                char nextCh = (value >> 24) & 0xff;
++                bitShift = 8;
++                if ((nextCh & 0x80) == 0)
++                    lastch = nextCh;
++                if (p >= uncompressed.count())
++                    uncompressed.resize(p+10);
++                uncompressed[p++] = nextCh;
++            }
++            else
++            {
++                for (unsigned j = 0; j < table_length; j++)
++                {
++                    if (table[j].last == lastch)
++                    {
++                        unsigned mask = 0, maskbit = 0x80000000;
++                        for (short kk = 0; kk < table[j].bits; kk++)
++                        {
++                            mask |= maskbit;
++                            maskbit >>= 1;
++                        }
++                        if ((value & mask) == table[j].value)
++                        {
++                            char nextCh = table[j].next;
++                            bitShift = table[j].bits;
++                            if (nextCh != STOP && nextCh != ESCAPE)
++                            {
++                                if (p >= uncompressed.count())
++                                    uncompressed.resize(p+10);
++                                uncompressed[p++] = nextCh;
++                            }
++                            found = true;
++                            lastch = nextCh;
++                            break;
++                        }
++                    }
++                }
++            }
++            if (found)
++            {
++                // Shift up by the number of bits.
++                for (unsigned b = 0; b < bitShift; b++)
++                {
++                    value = (value << 1) & 0xfffffffe;
++                    if (byte < size)
++                        value |= (src[byte] >> (7-bit)) & 1;
++                    if (bit == 7)
++                    {
++                        bit = 0;
++                        byte++;
++                    }
++                    else bit++;
++                }
++            }
++            else
++            {
++                // Entry missing in table.
++                QString result = QString::fromUtf8(uncompressed, p);
++                result.append("...");
++                return result;
++            }
++        } while (lastch != STOP && value != 0);
++
++        return QString::fromUtf8(uncompressed, p);
++    }
++    else return QString("");
++}
+diff -Nru mythtv-0.21/libs/libmythtv/mpeg/freesat_huffman.h mythtv-0.22-20081007/libs/libmythtv/mpeg/freesat_huffman.h
+--- mythtv-0.21/libs/libmythtv/mpeg/freesat_huffman.h	1970-01-01 00:00:00.000000000 +0000
++++ mythtv-0.22-20081007/libs/libmythtv/mpeg/freesat_huffman.h	2008-10-07 13:51:19.000000000 +0000
+@@ -0,0 +1,12 @@
++#ifndef _FREESAT_HUFFMAN_H_
++#define _FREESAT_HUFFMAN_H_
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list