Ticket #4271: legacy.patch

File legacy.patch, 14.6 KB (added by andrei@…, 12 years ago)
  • libs/libmythtv/avformatdecoder.cpp

     
    38233823
    38243824    enc_len = min((uint)enc_len, block_len - 8);
    38253825
    3826     swab(data, ucsamples + 8, enc_len);
     3826    swab((char*)data, (char*)(ucsamples + 8), enc_len);
    38273827
    38283828    // the following values come from libmpcodecs/ad_hwac3.c in mplayer.
    38293829    // they form a valid IEC958 AC3 header.
  • libs/libmythtv/frame.h

     
    8787    vf->repeat_pict      = 0;
    8888    vf->forcekey         = 0;
    8989
    90     bzero(vf->priv, 4 * sizeof(unsigned char *));
     90    memset(vf->priv, 0, 4 * sizeof(unsigned char *));
    9191
    9292    if (p)
    9393    {
     
    143143        unsigned int ysize  = vf->width * vf->height;
    144144        unsigned int uvsize = ysize >> 2;
    145145
    146         bzero( vf->buf + vf->offsets[0], ysize);
     146        memset(vf->buf + vf->offsets[0], 0, ysize);
    147147        memset(vf->buf + vf->offsets[1], 127, uvsize);
    148148        memset(vf->buf + vf->offsets[2], 127, uvsize);
    149149    }
  • libs/libmythtv/filtermanager.cpp

     
    1 #include <dlfcn.h>
    21#include <iostream>
    32#include <qdir.h>
    43#include <qstringlist.h>
     
    106105    if (handle)
    107106    {
    108107        FiltInfo = (FilterInfo *)dlsym(handle, "filter_table");
    109         if (dlerror() == NULL)
     108        if (FiltInfo != NULL)
    110109        {
    111110            for (; FiltInfo->symbol != NULL; FiltInfo++)
    112111            {
     
    414413                                        int &height, char *opts)
    415414{
    416415    void *handle;
    417     const char *error;
    418416    VideoFilter *Filter;
    419417    VideoFilter *(*InitFilter)(int, int, int *, int *, char *);
    420418
     
    441439
    442440    handle = dlopen(FiltInfo->libname, RTLD_NOW);
    443441
    444     if ((error = dlerror()))
     442    if (handle == NULL)
    445443    {
    446444        VERBOSE(VB_IMPORTANT, QString("FilterManager: unable to load "
    447445                "shared library '%1', dlopen reports error '%2'")
    448446                .arg(FiltInfo->libname)
    449                 .arg(error));
     447                .arg(dlerror()));
    450448        return NULL;
    451449    }
    452450
    453     if (handle == NULL)
    454     {
    455         VERBOSE(VB_IMPORTANT, QString("FilterManager: dlopen did not report "
    456                 "an error, but returned a NULL handle for shared library '%1'")
    457                 .arg(FiltInfo->libname));
    458         return NULL;
    459     }
    460 
    461451    InitFilter =
    462452        (VideoFilter * (*)(int, int, int *, int *, char *))dlsym(handle,
    463453                                                                 FiltInfo->
    464454                                                                 symbol);
    465455
    466     if ((error = dlerror()))
     456    if (InitFilter == NULL)
    467457    {
    468458        VERBOSE(VB_IMPORTANT, QString("FilterManager: unable to load symbol "
    469459                "'%1' from shared library '%2', dlopen reports error '%3'")
    470460                .arg(FiltInfo->symbol)
    471461                .arg(FiltInfo->libname)
    472                 .arg(error));
     462                .arg(dlerror()));
    473463        return NULL;
    474464    }
    475465
    476     if (InitFilter == NULL)
    477     {
    478         VERBOSE(VB_IMPORTANT, QString("FilterManager: dlopen did not report "
    479                 "an error, but returned NULL for symbol '%1' from shared "
    480                 "library '%2'")
    481                 .arg(FiltInfo->symbol)
    482                 .arg(FiltInfo->libname));
    483         return NULL;
    484     }
    485 
    486466    Filter = (*InitFilter)(inpixfmt, outpixfmt, &width, &height, opts);
    487467
    488468    if (Filter == NULL)
  • libs/libmythtv/mpeg/mpegstreamdata.cpp

     
    6969      _invalid_pat_seen(false), _invalid_pat_warning(false)
    7070{
    7171    _local_utc_offset = calc_utc_offset();
    72     bzero(_si_time_offsets, sizeof(_si_time_offsets));
     72    memset(_si_time_offsets, 0, sizeof(_si_time_offsets));
    7373
    7474    AddListeningPID(MPEG_PAT_PID);
    7575}
  • libs/libmythtv/mpeg/mpegtables.h

     
    509509    const QString toString(void) const;
    510510
    511511  private:
    512     static ProgramAssociationTable* CreateBlank(bool small = true);
     512    static ProgramAssociationTable* CreateBlank(bool _small = true);
    513513};
    514514
    515515/** \class ProgramMapTable
     
    660660        memcpy(psipdata() + 4, streamInfo, infoLength);
    661661    }
    662662
    663     static ProgramMapTable* CreateBlank(bool small = true);
     663    static ProgramMapTable* CreateBlank(bool _small = true);
    664664
    665665    static const uint pmt_header = 4; // minimum PMT header offset
    666666    mutable vector<unsigned char*> _ptrs; // used to parse
  • libs/libmythtv/mpeg/mpegtables.cpp

     
    236236    return true;
    237237}
    238238
    239 ProgramAssociationTable* ProgramAssociationTable::CreateBlank(bool small)
     239ProgramAssociationTable* ProgramAssociationTable::CreateBlank(bool _small)
    240240{
    241     (void) small; // currently always a small packet..
     241    (void) _small; // currently always a small packet..
    242242    TSPacket *tspacket = TSPacket::CreatePayloadOnlyPacket();
    243243    memcpy(tspacket->data() + sizeof(TSHeader) + 1/* start of field pointer */,
    244244           DEFAULT_PAT_HEADER, sizeof(DEFAULT_PAT_HEADER));
     
    286286    return pat;
    287287}
    288288
    289 ProgramMapTable* ProgramMapTable::CreateBlank(bool small)
     289ProgramMapTable* ProgramMapTable::CreateBlank(bool _small)
    290290{
    291291    ProgramMapTable *pmt = NULL;
    292292    TSPacket *tspacket = TSPacket::CreatePayloadOnlyPacket();
    293293    memcpy(tspacket->data() + sizeof(TSHeader) + 1/* start of field pointer */,
    294294           DEFAULT_PMT_HEADER, sizeof(DEFAULT_PMT_HEADER));
    295295
    296     if (small)
     296    if (_small)
    297297    {
    298298        PSIPTable psip = PSIPTable::View(*tspacket);
    299299        psip.SetLength(len_for_alloc[0]);
  • libs/libmythtv/cc608decoder.cpp

     
    3535        txtmode[i*2+1] =  0;
    3636    }
    3737
    38     bzero(lastrow, sizeof(lastrow));
    39     bzero(newrow,  sizeof(newrow));
    40     bzero(newcol,  sizeof(newcol));
    41     bzero(timecode, sizeof(timecode));
    42     bzero(row,      sizeof(row));
    43     bzero(col,      sizeof(col));
    44     bzero(rowcount, sizeof(rowcount));
    45     bzero(style,    sizeof(style));
    46     bzero(linecont, sizeof(linecont));
    47     bzero(resumetext, sizeof(resumetext));
    48     bzero(lastclr, sizeof(lastclr));
     38    memset(lastrow,  0, sizeof(lastrow));
     39    memset(newrow,   0, sizeof(newrow));
     40    memset(newcol,   0, sizeof(newcol));
     41    memset(timecode, 0, sizeof(timecode));
     42    memset(row,      0, sizeof(row));
     43    memset(col,      0, sizeof(col));
     44    memset(rowcount, 0, sizeof(rowcount));
     45    memset(style,    0, sizeof(style));
     46    memset(linecont, 0, sizeof(linecont));
     47    memset(resumetext, 0, sizeof(resumetext));
     48    memset(lastclr,  0, sizeof(lastclr));
    4949
    5050    for (uint i = 0; i < 8; i++)
    5151        ccbuf[i] = "";
     
    6565    stdchar[127] = 0x2588; /* full block */
    6666
    6767    // VPS data
    68     bzero(vps_pr_label, sizeof(vps_pr_label));
    69     bzero(vps_label,    sizeof(vps_label));
     68    memset(vps_pr_label, 0, sizeof(vps_pr_label));
     69    memset(vps_label,    0, sizeof(vps_label));
    7070
    7171    // XDS data
    72     bzero(xds_rating, sizeof(uint) * 2 * 4);
     72    memset(xds_rating, 0, sizeof(uint) * 2 * 4);
    7373    for (uint i = 0; i < 2; i++)
    7474    {
    7575        xds_rating_systems[i] = 0;
  • libs/libavformat/utils.c

     
    28022802
    28032803int64_t parse_date(const char *datestr, int duration)
    28042804{
    2805     struct tm time_r;
    28062805    const char *p;
    28072806    int64_t t;
    28082807    struct tm dt;
     
    28472846         * current year-month-day time */
    28482847        if (!q) {
    28492848            if (is_utc) {
    2850                 dt = *gmtime_r(&now, &time_r);
     2849                dt = *gmtime(&now);
    28512850            } else {
    2852                 dt = *localtime_r(&now, &time_r);
     2851                dt = *localtime(&now);
    28532852            }
    28542853            dt.tm_hour = dt.tm_min = dt.tm_sec = 0;
    28552854        } else {
  • libs/libmyth/audiooutputbase.cpp

     
    6064    pthread_mutex_init(&avsync_lock, NULL);
    6165    pthread_cond_init(&audio_bufsig, NULL);
    6266
    63     output_audio = 0; // TODO FIXME Not POSIX compatible!
     67    memset(&output_audio,      0, sizeof(pthread_t));
     68    memset(&src_data,          0, sizeof(SRC_DATA));
     69    memset(src_in,             0, sizeof(float) * AUDIO_SRC_IN_SIZE);
     70    memset(src_out,            0, sizeof(float) * AUDIO_SRC_OUT_SIZE);
     71    memset(tmp_buff,           0, sizeof(short) * AUDIO_TMP_BUF_SIZE);
     72    memset(&audiotime_updated, 0, sizeof(audiotime_updated));
     73    memset(audiobuffer,        0, sizeof(char)  * AUDBUFSIZE);
    6474
    65     bzero(&src_data,          sizeof(SRC_DATA));
    66     bzero(src_in,             sizeof(float) * AUDIO_SRC_IN_SIZE);
    67     bzero(src_out,            sizeof(float) * AUDIO_SRC_OUT_SIZE);
    68     bzero(tmp_buff,           sizeof(short) * AUDIO_TMP_BUF_SIZE);
    69     bzero(&audiotime_updated, sizeof(audiotime_updated));
    70     bzero(audiobuffer,        sizeof(char)  * AUDBUFSIZE);
    71 
    7275    // You need to call Reconfigure from your concrete class.
    7376    // Reconfigure(laudio_bits,       laudio_channels,
    7477    //             laudio_samplerate, laudio_passthru);
     
    246249
    247250void AudioOutputBase::StopOutputThread(void)
    248251{
     252#ifdef CONFIG_MINGW
     253    if (output_audio.p)
     254#else
    249255    if (output_audio)
     256#endif
    250257    {
    251258        pthread_join(output_audio, NULL);
    252         output_audio = 0;
     259        memset(&output_audio, 0, sizeof(pthread_t));
    253260    }
    254261}
    255262
  • libs/libmythdvdnav/searching.c

     
    120120}
    121121
    122122dvdnav_status_t dvdnav_time_search(dvdnav_t *this,
    123                                    uint64_t time, uint search_to_nearest_cell) {
     123                                   uint64_t time, uint32_t search_to_nearest_cell) {
    124124 
    125125  uint64_t target = time;
    126126  uint64_t length = 0;
  • libs/libmythdvdnav/dvdnav.h

     
    367365 * Otherwise tries to guess the nearest VOBU by calculating an offset.
    368366 */
    369367dvdnav_status_t dvdnav_time_search(dvdnav_t *self,
    370                                    uint64_t time, uint search_to_nearest_cell);
     368                                   uint64_t time, uint32_t search_to_nearest_cell);
    371369
    372370int dvdnav_time_search_within_cell(dvdnav_t *self,
    373371                   int relative_time);
  • libs/libmythupnp/ssdp.cpp

     
    5353
    5454    // Setup SearchSocket
    5555
    56     m_Sockets[ SocketIdx_Search ]->bind( INADDR_ANY, m_nSearchPort );
     56    m_Sockets[ SocketIdx_Search ]->bind( (Q_UINT32)INADDR_ANY, m_nSearchPort );
    5757
    5858    m_pNotifyTask   = NULL;
    5959
  • programs/mythfrontend/main.cpp

     
    12731273    if (status)
    12741274    {
    12751275        perror("pthread_create");
    1276         priv_thread = 0;
     1276        memset(&priv_thread, 0, sizeof(pthread_t));
    12771277    }
    12781278    setuid(getuid());
    12791279
  • programs/mythtv/main.cpp

     
    232236    if (status)
    233237    {
    234238        perror("pthread_create");
    235         priv_thread = 0;
     239        memset(&priv_thread, 0, sizeof(pthread_t));
    236240    }
    237241    setuid(getuid());
    238242
  • filters/quickdnr/filter_quickdnr.c

     
    469469        return NULL;
    470470    }
    471471
    472     bzero(filter, sizeof(ThisFilter));
     472    memset(filter, 0, sizeof(ThisFilter));
    473473    filter->vf.cleanup        = &cleanup;
    474474    filter->Luma_threshold1   = LUMA_THRESHOLD1_DEFAULT;
    475475    filter->Chroma_threshold1 = CHROMA_THRESHOLD1_DEFAULT;
  • filters/ivtc/filter_ivtc.c

     
    206206        return NULL;
    207207    }
    208208
    209     bzero (filter, sizeof (ThisFilter));
     209    memset (filter, 0, sizeof (ThisFilter));
    210210    filter->progressive_frame_seen = 0;
    211211    filter->interlaced_frame_seen = 0;
    212212    filter->apply_filter = 0;
  • filters/denoise3d/filter_denoise3d.c

     
    408408        return NULL;
    409409    }
    410410
    411     bzero(filter, sizeof (ThisFilter));
     411    memset(filter, 0, sizeof (ThisFilter));
    412412
    413413    filter->vf.filter = &denoise3DFilter;
    414414    filter->vf.cleanup = &Denoise3DFilterCleanup;
  • programs/mythfrontend/globalsettings.cpp

     
    46104626
    46114627    theme->addChild(new ThemeSelector("Theme"));
    46124628
    4613     HorizontalConfigurationGroup *grp1 =
     4629    HorizontalConfigurationGroup *hgrp1 =
    46144630        new HorizontalConfigurationGroup(false, false, false, false);
    4615     grp1->addChild(RandomTheme());
    4616     grp1->addChild(ThemeCacheSize());
    4617     theme->addChild(grp1);
     4631    hgrp1->addChild(RandomTheme());
     4632    hgrp1->addChild(ThemeCacheSize());
     4633    theme->addChild(hgrp1);
    46184634
    46194635    theme->addChild(ThemePainter());
    46204636    theme->addChild(new StyleSetting());