Ticket #3544: athome-eit.diff

File athome-eit.diff, 4.1 KB (added by dvbmail@…, 17 years ago)

Add EIT fixes for @Home network in the Netherlands.

  • mythtv/libs/libmythtv/eitfixup.cpp

    diff -u -r -x .svn ./a/mythtv/libs/libmythtv/eitfixup.cpp ./mythtv/libs/libmythtv/eitfixup.cpp
    ./a .  
    7171    if (kFixAUStar & event.fixup)
    7272        FixAUStar(event);
    7373
     74    if (kFixAtHome & event.fixup)
     75        FixAtHome(event);
     76
    7477    if (event.fixup)
    7578    {
    7679        if (!event.title.isEmpty())
     
    629632        event.description    = stmp.right(stmp.length() - position - 2);
    630633    }
    631634}
     635
     636/** \fn EITFixUp::FixAtHome(DBEvent&) const
     637 *  \brief Use this to clean up DVB-C guide from AtHome in the Netherlands.
     638 */
     639void EITFixUp::FixAtHome(DBEvent &event) const
     640{
     641
     642    // Try to get the sub-title from the description (if empty).
     643    if(event.subtitle.isEmpty())
     644    {
     645        int position = event.description.find("Afl.");
     646        if (position != -1)
     647        {
     648            // See if there's a ":" following, if so; ignore.
     649            if(event.description.at(position + 4) == ':')
     650                position++;
     651            // now search for a "." indicating the end of the sub-title
     652            int endposition = event.description.find('.', (position + 4));
     653            if (endposition != -1)
     654            {
     655                // Copy the found part
     656                event.subtitle = event.description.mid(position + 4,
     657                                     endposition - (position + 4));
     658            }
     659        }
     660    }
     661    // Try to get a subtitle from the title by searching for a ":" and
     662    // splitting the title
     663    if(event.subtitle.isEmpty())
     664    {
     665        int position = event.title.find(':');
     666        if (position != -1)
     667        {
     668            event.subtitle = event.title.right(
     669                event.title.length() - position - 2);
     670            event.title = event.title.left(position);
     671        }
     672    }
     673    // There's more information in the description block but this is
     674    // sufficient for me :-)
     675}
  • mythtv/libs/libmythtv/eitfixup.h

    diff -u -r -x .svn ./a/mythtv/libs/libmythtv/eitfixup.h ./mythtv/libs/libmythtv/eitfixup.h
    ./a .  
    2727        kFixComHem     = 0x0010,
    2828        kFixSubtitle   = 0x0020,
    2929        kFixAUStar     = 0x0040,
     30        kFixAtHome     = 0x0080, // Both early and regular
    3031
    3132        // Early fixups
    3233        kEFixPro7Sat   = 0x0100,
     
    5152    void FixPBS(DBEvent &event) const;           // USA ATSC
    5253    void FixComHem(DBEvent &event, bool parse_subtitle) const; // Sweden DVB-C
    5354    void FixAUStar(DBEvent &event) const;        // Australia DVB-S
     55    void FixAtHome(DBEvent &event) const;        // Netherlands AtHome DVB-C
    5456
    5557    const QRegExp m_bellYear;
    5658    const QRegExp m_bellActors;
  • mythtv/libs/libmythtv/eithelper.cpp

    diff -u -r -x .svn ./a/mythtv/libs/libmythtv/eithelper.cpp ./mythtv/libs/libmythtv/eithelper.cpp
    ./a .  
    288288                else
    289289                {
    290290                    title    = sed.EventName();
    291                     subtitle = sed.Text();
     291                    if (fix & EITFixUp::kFixAtHome)
     292                        description = sed.Text();
     293                    else
     294                        subtitle = sed.Text();
    292295                }
    293296            }
    294297
     
    296299                MPEGDescriptor::FindBestMatches(
    297300                    list, DescriptorID::extended_event, languagePreferences);
    298301
    299             description = "";
    300302            for (uint j = 0; j < bestExtendedEvents.size(); j++)
    301303            {
    302304                if (!bestExtendedEvents[j])
     
    584586    fix[1082LL << 32 |    1 << 16 | 20005] = EITFixUp::kEFixPro7Sat; //DVB-S Sat.1 Austria
    585587
    586588    fix[ 133 << 16] = EITFixUp::kEFixPro7Sat; // Premiere and Pro7/Sat.1
     589
     590    // DVB-C Netherlands: EIT format and sub-title fixes
     591    // transport_id<<32 | original_network_id<<16 | service_id
     592    fix[ 1000 << 16 ] = EITFixUp::kFixAtHome;
     593
    587594}
    588595
    589596static int calc_eit_utc_offset(void)