Question

Salve, ho il seguente problema: ho del codice scritto in Visual C++ 2010(progetto FireBreath) che vuole aprire uno stream utilizzando PortAudio.

Hello, I have the following problem: I've got some Visual C++ code (FireBreath) that wants to open a stream using PortAudio

Dopo aver fatto tutte le operazioni iniziali, ho le seguenti righe di codice:

After having done all the initial operations, I have this ... code:

err = Pa_OpenStream( &stream, &parametriIngresso, &parametriUscita, SAMPLE_RATE, FRAMES_PER_BUFFER, 0, My_Callback, &myData);
err = Pa_StartStream(stream);

while( ( err = Pa_IsStreamActive( stream ) ) == 1 )
    {
        Pa_Sleep(1000);
    }

err = Pa_CloseStream(stream);

Questa funzione è chiamata attraverso un file in Javascript e dopo un certo numero di secondi, il Plugin fa crash dandomi un errore proprio sulla riga dove viene chiamata, in Javascript, la funzione.

This function is called from JavaScript, and after a certain number of seconds the plugin crashes giving me an error on the line where it's called from in the JavaScript.

L'errore è il seguente: Error calling method on NPObject!

The error is: ...

Chi mi sa aiutare? Grazie mille...

Who can help me? Many thanks ...

Was it helpful?

Solution 2

This is a problem of thread. Thread principal is busy for more time from plugin and since Javascript is single-threading, it crash. The solution is create the new thread.

OTHER TIPS

Error calling method on NPObject! is the error you get on most current browsers whenever anything goes wrong. You used to be able to send exception text from a NPAPI plugin (like a firebreath plugin) but all of the browsers have stopped passing this correctly recently.

Anyway, the upshot of this is that all that error message tells you for sure is that something went wrong in your plugin; if the plugin is actually crashing, the error message "Error calling method on NPObject!" has nothing to do with the actual crash, but rather just means "we were trying to call something on a plugin that crashed". Attach a debugger and find out what caused the crash and you will be closer to finding out what is actually happening.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top