[mythtv-commits] Ticket #8211: Incorrect channel change with a channel group and multiple sources

MythTV mythtv at cvs.mythtv.org
Sun Mar 21 22:20:28 UTC 2010


#8211: Incorrect channel change with a channel group and multiple sources
---------------------------------+------------------------------------------
 Reporter:  scottadmi@…          |       Owner:  ijr       
     Type:  defect               |      Status:  new       
 Priority:  minor                |   Milestone:  0.24      
Component:  MythTV - General     |     Version:  0.22-fixes
 Severity:  medium               |     Mlocked:  0         
---------------------------------+------------------------------------------

Comment(by scottadmi@…):

 A quick fix that incorporates the GetNextChannel function code modified to
 use channum (instead of chanid) into the ChangeChannel function (probably
 not the perfect solution, but it does the job for now). In
 libs/libmythtv/tv_play.cpp replace lines 6742 through 6750 with this:


 {{{
       // Collect channel info
        const ProgramInfo pginfo(*ctx->playingInfo);



        QString old_channum  = pginfo.chanstr;
        ctx->UnlockPlayingInfo(__FILE__, __LINE__);


        DBChanList::const_iterator it = m_channellist.begin();
        for ( ;it != m_channellist.end(); it++)
           if ( it->channum == old_channum )
               break;

        if (it == m_channellist.end()) {
            VERBOSE(VB_IMPORTANT, "ChangeChannel did not find current
 channel in list.");
            it = m_channellist.begin(); // not in list, pretend we are on
 first channel
        }

        if (it == m_channellist.end())
            return; // no channels..

        DBChanList::const_iterator start = it;
        bool skip_non_visible = true; // TODO make DB selectable

        if (CHANNEL_DIRECTION_DOWN == direction)
        {
            do
            {
                if (it == m_channellist.begin())
                    it = find(m_channellist.begin(), m_channellist.end(),
                              m_channellist.rbegin()->chanid);
                else
                    it--;
            }
            while ((it != start) && (skip_non_visible && !it->visible));
        }
        else if ((CHANNEL_DIRECTION_UP == direction) ||
 (CHANNEL_DIRECTION_FAVORITE == direction))
        {
            do
            {
                it++;
                if (it == m_channellist.end())
                    it = m_channellist.begin();
            }
            while ((it != start) && (skip_non_visible && !it->visible));
        }
        ChangeChannel(ctx, 0, it->channum);


        return;
 }}}

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/8211#comment:1>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list