opus_dred_parse() sets dred_end to 0 when no DRED
Also, fix documentation about return value of zero.
This commit is contained in:
parent
6ac0c87112
commit
57901a6758
2 changed files with 2 additions and 1 deletions
|
@ -583,7 +583,7 @@ OPUS_EXPORT void opus_dred_free(OpusDRED *dec);
|
||||||
* @param [in] sampling_rate <tt>opus_int32</tt>: Sampling rate used for max_dred_samples argument. Needs not match the actual sampling rate of the decoder.
|
* @param [in] sampling_rate <tt>opus_int32</tt>: Sampling rate used for max_dred_samples argument. Needs not match the actual sampling rate of the decoder.
|
||||||
* @param [out] dred_end <tt>opus_int32*</tt>: Number of non-encoded (silence) samples between the DRED timestamp and the last DRED sample.
|
* @param [out] dred_end <tt>opus_int32*</tt>: Number of non-encoded (silence) samples between the DRED timestamp and the last DRED sample.
|
||||||
* @param [in] defer_processing <tt>int</tt>: Flag (0 or 1). If set to one, the CPU-intensive part of the DRED decoding is deferred until opus_dred_process() is called.
|
* @param [in] defer_processing <tt>int</tt>: Flag (0 or 1). If set to one, the CPU-intensive part of the DRED decoding is deferred until opus_dred_process() is called.
|
||||||
* @returns Offset (positive) of the first decoded DRED samples or @ref opus_errorcodes
|
* @returns Offset (positive) of the first decoded DRED samples, zero if no DRED is present, or @ref opus_errorcodes
|
||||||
*/
|
*/
|
||||||
OPUS_EXPORT int opus_dred_parse(OpusDREDDecoder *dred_dec, OpusDRED *dred, const unsigned char *data, opus_int32 len, opus_int32 max_dred_samples, opus_int32 sampling_rate, int *dred_end, int defer_processing) OPUS_ARG_NONNULL(1);
|
OPUS_EXPORT int opus_dred_parse(OpusDREDDecoder *dred_dec, OpusDRED *dred, const unsigned char *data, opus_int32 len, opus_int32 max_dred_samples, opus_int32 sampling_rate, int *dred_end, int defer_processing) OPUS_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
|
|
@ -1420,6 +1420,7 @@ int opus_dred_parse(OpusDREDDecoder *dred_dec, OpusDRED *dred, const unsigned ch
|
||||||
if (dred_end) *dred_end = IMAX(0, -dred->dred_offset*sampling_rate/400);
|
if (dred_end) *dred_end = IMAX(0, -dred->dred_offset*sampling_rate/400);
|
||||||
return IMAX(0, dred->nb_latents*sampling_rate/25 - dred->dred_offset* sampling_rate/400);
|
return IMAX(0, dred->nb_latents*sampling_rate/25 - dred->dred_offset* sampling_rate/400);
|
||||||
}
|
}
|
||||||
|
if (dred_end) *dred_end = 0;
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
(void)dred_dec;
|
(void)dred_dec;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue