Ticket #4376: ticket_4376_causing_embedded_playbackbox_to_hang.diff

File ticket_4376_causing_embedded_playbackbox_to_hang.diff, 2.7 KB (added by skamithi, 18 years ago)
  • libs/libmythtv/tv_play.h

     
    215215    static void InitKeys(void);
    216216    static bool StartTV(ProgramInfo *tvrec = NULL, bool startInGuide = false,
    217217                        bool inPlaylist = false, bool initByNetworkCommand = false);
    218     static void SetEmbedPbbFunc(RUNPLAYBACKBOX lptr);
     218    static void SetFuncPtr(const char *, void *);
    219219
    220220    void SetIgnoreKeys(bool ignore) { ignoreKeys = ignore; }
    221221
     
    238238
    239239  protected:
    240240    void doEditSchedule(int editType = kScheduleProgramGuide);
     241    static void *RecordedShowMenuHandler(void *param);
     242
    241243    void RunTV(void);
    242244    static void *EventThread(void *param);
    243245    void SetMuteTimer(int timeout);
  • libs/libmythtv/tv_play.cpp

     
    252252
    253253    return playCompleted;
    254254}
    255        
    256 void TV::SetEmbedPbbFunc(RUNPLAYBACKBOX lptr)
     255
     256/**
     257 * \brief Import pointers to functions used to embed the TV
     258 * window into other containers e.g. playbackbox
     259 */
     260void TV::SetFuncPtr(const char *string, void *lptr)
    257261{
    258     RunPlaybackBoxPtr = lptr;
     262    QString name = QString(string);
     263    if (name == "playbackbox")
     264        RunPlaybackBoxPtr = (RUNPLAYBACKBOX)lptr;
    259265}
    260266
    261267void TV::InitKeys(void)
     
    56695675        nvp->DrawUnusedRects(sync);
    56705676}
    56715677
     5678void *TV::RecordedShowMenuHandler(void *param)
     5679{
     5680    TV *obj = (TV *)param;
     5681    obj->doEditSchedule(kPlaybackBox);
     5682
     5683    return NULL;
     5684}
     5685
    56725686void TV::doEditSchedule(int editType)
    56735687{
    56745688    if (!playbackinfo)
     
    58275841
    58285842void TV::EditSchedule(int editType)
    58295843{
     5844    if (editType == kPlaybackBox && menurunning != true)
     5845    {
     5846        menurunning = true;
     5847        pthread_t tid;
     5848        pthread_attr_t attr;
     5849        pthread_attr_init(&attr);
     5850        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
     5851
     5852        pthread_create(&tid, &attr, TV::RecordedShowMenuHandler, this);
     5853        pthread_attr_destroy(&attr);
     5854
     5855        return;
     5856    }
     5857
    58305858    // post the request to the main UI thread
    58315859    // it will be caught in eventFilter and processed as CustomEvent
    58325860    // this will create the program guide window (widget)
  • programs/mythfrontend/main.cpp

     
    801801
    802802    TV::InitKeys();
    803803
    804     TV::SetEmbedPbbFunc(PlaybackBox::RunPlaybackBox);
     804    TV::SetFuncPtr("playbackbox", (void *)PlaybackBox::RunPlaybackBox);
    805805}
    806806
    807807