diff --git a/docs/manual/index.html b/docs/manual/index.html index 5aa4e192..a68551b0 100644 --- a/docs/manual/index.html +++ b/docs/manual/index.html @@ -981,6 +981,10 @@ entitlements.xcent file: <true/>
+See this discussion for more info: https://github.com/mackron/miniaudio/issues/203. +
++
@@ -2712,7 +2716,7 @@ manage your job threads if, for example, you want to integrate the job processin existing job infrastructure, or if you simply don't like the way the resource manager does it. To do this, just set the job thread count to 0 and process jobs manually. To process jobs, you first need to retrieve a job using ma_resource_manager_next_job() and then process it using -ma_resource_manager_process_job(): +ma_job_process():
@@ -2727,7 +2731,7 @@ config.flags = MA_RESOURCE_MANAGER_FLAG_NON_BLOCKING; void my_custom_job_thread(...) { for (;;) { - ma_resource_manager_job job; + ma_job job; ma_result result = ma_resource_manager_next_job(pMyResourceManager, &job); if (result != MA_SUCCESS) { if (result == MA_NOT_DATA_AVAILABLE) { @@ -2735,7 +2739,7 @@ config.flags = MA_RESOURCE_MANAGER_FLAG_NON_BLOCKING; // with MA_RESOURCE_MANAGER_FLAG_NON_BLOCKING. continue; } else if (result == MA_CANCELLED) { - // MA_RESOURCE_MANAGER_JOB_QUIT was posted. Exit. + // MA_JOB_TYPE_QUIT was posted. Exit. break; } else { // Some other error occurred. @@ -2743,16 +2747,16 @@ config.flags = MA_RESOURCE_MANAGER_FLAG_NON_BLOCKING; MA_RESOURCE_MANAGER_JOB_QUIT event is the used as the termination +In the example above, the MA_JOB_TYPE_QUIT event is the used as the termination indicator, but you can use whatever you would like to terminate the thread. The call to ma_resource_manager_next_job() is blocking by default, but can be configured to be non-blocking by initializing the resource manager with the MA_RESOURCE_MANAGER_FLAG_NON_BLOCKING configuration -flag. Note that the MA_RESOURCE_MANAGER_JOB_QUIT will never be removed from the job queue. This +flag. Note that the MA_JOB_TYPE_QUIT will never be removed from the job queue. This is to give every thread the opportunity to catch the event and terminate naturally.
@@ -3083,7 +3087,7 @@ pthread_mutex_unlock(&pSemaphore->lock);
Again, this is relevant for those with strict lock-free requirements in the audio thread. To avoid -this, you can use non-blocking mode (via the MA_RESOURCE_MANAGER_JOB_QUEUE_FLAG_NON_BLOCKING +this, you can use non-blocking mode (via the MA_JOB_QUEUE_FLAG_NON_BLOCKING flag) and implement your own job processing routine (see the "Resource Manager" section above for details on how to do this).
@@ -3147,7 +3151,7 @@ completed MA_SUCCESS will be returneWhen loading asynchronously, a single job is posted to the queue of the type -MA_RESOURCE_MANAGER_JOB_LOAD_DATA_BUFFER_NODE. This involves making a copy of the file path and +MA_JOB_TYPE_RESOURCE_MANAGER_LOAD_DATA_BUFFER_NODE. This involves making a copy of the file path and associating it with job. When the job is processed by the job thread, it will first load the file using the VFS associated with the resource manager. When using a custom VFS, it's important that it be completely thread-safe because it will be used from one or more job threads at the same time. @@ -3160,9 +3164,9 @@ block of memory to store the decoded output and initialize it to silence. If the it will allocate room for one page. After memory has been allocated, the first page will be decoded. If the sound is shorter than a page, the result code will be set to MA_SUCCESS and the completion event will be signalled and loading is now complete. If, however, there is more to -decode, a job with the code MA_RESOURCE_MANAGER_JOB_PAGE_DATA_BUFFER_NODE is posted. This job +decode, a job with the code MA_JOB_TYPE_RESOURCE_MANAGER_PAGE_DATA_BUFFER_NODE is posted. This job will decode the next page and perform the same process if it reaches the end. If there is more to -decode, the job will post another MA_RESOURCE_MANAGER_JOB_PAGE_DATA_BUFFER_NODE job which will +decode, the job will post another MA_JOB_TYPE_RESOURCE_MANAGER_PAGE_DATA_BUFFER_NODE job which will keep on happening until the sound has been fully decoded. For sounds of an unknown length, each page will be linked together as a linked list. Internally this is implemented via the ma_paged_audio_buffer object.