Memory access error while attach player?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> You could remove the
>
>   cControl::Attach();
>
> call from your code (this is done in VDR's main loop in the
> foreground thread) and add a mutex to cControl that guards
> all calls to its member functions.
>
> Klaus

What did you mean by "add"? I can't find a mutex in cControl.

Did you mean this?: (myMutex is a private cMutex from cMyPlayer)

bool cMyPlayer::start(const char *path)
{
    cMutexLock MutexLock(&myMutex);   
    cRecording *recording = Recordings.GetByName(path);
    if (recording) {
        cReplayControl::SetRecording(NULL, NULL);
        cControl::Shutdown();
        cResumeFile resume(recording->FileName());
        resume.Delete();
        cReplayControl::SetRecording(recording->FileName(), 
recording->Title());
        cControl::Launch(new cReplayControl);
       // cControl::Attach(); //will done in the foreground thread
        return true;
    }else
        return false;
}

In this case I only protect my own function. This will protect that my 
thread can't recall start until it is done. Thats OK.
Or did you mean that I need to patch the cControl by adding a Mutex and 
protect all memberfunctions? If I do so, will you add this patch to 
upcoming vdr versions? I don't want to patch all upcoming versions.

Patrick


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux