[mythtv-users] Commercial Flagging (UK, DVB-T)

Robert Longbottom rongblor at googlemail.com
Tue Feb 12 20:36:19 UTC 2013


On 12/02/2013 10:58, phipps-hutton at sky.com wrote:
>
> Quoting Roger Siddons <dizygotheca at ntlworld.com>:
>> Whilst you're updating it, I had a couple of comments that I forgot to
>> mention earlier;
>>
>> 1. Why do you set avconv to debug output ("-v 8") ? It seemed to run
>> twice as fast with no adverse effects when I turned it off.
>>
> Accidently left in from debugging, now changed to "-v fatal".
>
>> 2. The 'comflagged' states are: 0=not flagged, 1=flagged, 2=in
>> progress, 3=commfree.
>
> Do you (or anyone listening) know how to get the frontends to update the
> skiplist if they are watching the same program? I have to stop playback
> and start again to reload the skiplist.

I'd love to see this working as well.  My C isn't great and I've never 
looked far into the mythtv codebase but it would appear that 
mythcommflag sends a "message" that somehow gets to the player:

In programs/mythcommflag/main.cpp:

static void commDetectorGotNewCommercialBreakList(void)
{
     frm_dir_map_t newCommercialMap;
     commDetector->GetCommercialBreakList(newCommercialMap);

     frm_dir_map_t::Iterator it = newCommercialMap.begin();
     QString message = "COMMFLAG_UPDATE ";
     message += global_program_info->MakeUniqueKey();

     for (it = newCommercialMap.begin();
             it != newCommercialMap.end(); ++it)
     {
         if (it != newCommercialMap.begin())
             message += ",";
         else
             message += " ";
         message += QString("%1:%2").arg(it.key())
                    .arg(*it);
     }

     LOG(VB_COMMFLAG, LOG_INFO,
         QString("mythcommflag sending update: %1").arg(message));

     gCoreContext->SendMessage(message);
}

and in libs/libmythtv/tv_play.cpp (the only other place in the 
mythcodebase that "COMMFLAG_UPDATE" is mentioned based on my grep of the 
.cpp files in the code:

     if (message.left(15) == "COMMFLAG_UPDATE" && (tokens.size() >= 3))
     {
         uint evchanid = 0;
         QDateTime evrecstartts;
         ProgramInfo::ExtractKey(tokens[1], evchanid, evrecstartts);

         PlayerContext *mctx = GetPlayerReadLock(0, __FILE__, __LINE__);
         for (uint i = 0; mctx && evchanid && (i < player.size()); i++)
         {
             PlayerContext *ctx = GetPlayer(mctx, i);
             ctx->LockPlayingInfo(__FILE__, __LINE__);
             bool doit =
                 ((ctx->playingInfo) &&
                  (ctx->playingInfo->GetChanID()             == evchanid) &&
                  (ctx->playingInfo->GetRecordingStartTime() == 
evrecstartts));
             ctx->UnlockPlayingInfo(__FILE__, __LINE__);


I'm not sure if this helps, but if there was some way to "send a 
message" into the mythtv infrastructure and you could work out the 
message format then maybe it could be integrated.

Rob.



More information about the mythtv-users mailing list