Stopping function called from main thread

10 views
Skip to first unread message

m.abum...@gmail.com

unread,
Aug 28, 2016, 1:00:56 PM8/28/16
to Native-Client-Discuss, Mohammad Abu Musa

I am writing an audio encoder that takes the input from the microphone and convert it to ogg file. I am using the media_stream_audio example

The following function keeps working even when I click stop recording which is suppose cancel this operation. I tried to have a separate thread to handle this but it did not work.

My question is how can I stop this schedule when the flag is_recording is false? if I can not what is the best approach to do this

  void ScheduleNextTimer() {
    PP_DCHECK(timer_interval_ > 0);
    pp::Module::Get()->core()->CallOnMainThread(
        timer_interval_,
        callback_factory_.NewCallback(&MediaStreamAudioInstance::OnTimer),
        0);
  }
Reply all
Reply to author
Forward
0 new messages