Skip to content

Commit

Permalink
Add extra logging for dummy resample imp (#3863)
Browse files Browse the repository at this point in the history
  • Loading branch information
deeagle001 authored Feb 21, 2024
1 parent fc3b03c commit 7178ab0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pjmedia/src/pjmedia/resample_resample.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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).
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 7178ab0

Please sign in to comment.