Add extra logging for dummy resample imp (#3863)

This commit is contained in:
Akos Denke 2024-02-21 09:32:16 +01:00 committed by GitHub
parent fc3b03c937
commit 7178ab01a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 7 deletions

View File

@ -24,14 +24,12 @@
#include <pj/log.h>
#include <pj/pool.h>
#define THIS_FILE "resample.c"
#if PJMEDIA_RESAMPLE_IMP==PJMEDIA_RESAMPLE_LIBRESAMPLE
#include <third_party/resample/include/resamplesubs.h>
#define THIS_FILE "resample.c"
struct pjmedia_resample
{
@ -158,7 +156,7 @@ PJ_DEF(void) pjmedia_resample_run( pjmedia_resample *resample,
* So here comes the trick.
*
* First of all, because of the history and lookahead requirement,
* resample->buffer need to accomodate framesize+2*xoff samples in its
* resample->buffer need to accommodate framesize+2*xoff samples in its
* buffer. This is done when the buffer is created.
*
* On the first run, the input frame (supplied by application) is
@ -176,8 +174,8 @@ PJ_DEF(void) pjmedia_resample_run( pjmedia_resample *resample,
* | 0000 | 0000 | frame0... |
* +------+------+--------------+
* ^ ^ ^ ^
* 0 xoff 2*xoff size+2*xoff
*
* 0 xoff 2*xoff size+2*xoff
*
* (Note again: resample algorithm is called at resample->buffer+xoff)
*
* At the end of the run, 2*xoff samples from the end of
@ -204,7 +202,7 @@ PJ_DEF(void) pjmedia_resample_run( pjmedia_resample *resample,
* | frm0 | frm0 | frame1... |
* +------+------+--------------+
* ^ ^ ^ ^
* 0 xoff 2*xoff size+2*xoff
* 0 xoff 2*xoff size+2*xoff
*
* As you can see from above diagram, the resampling algorithm is
* actually called from the last xoff part of previous frame (frm0).
@ -320,6 +318,8 @@ PJ_DEF(pj_status_t) pjmedia_resample_create( pj_pool_t *pool,
PJ_UNUSED_ARG(samples_per_frame);
PJ_UNUSED_ARG(p_resample);
PJ_LOG(3, (THIS_FILE, "No resampler created (sample rate conversion is "
"disabled or no resample implementation selected)"));
return PJ_EINVALIDOP;
}