[asterisk-bugs] [JIRA] (ASTERISK-16633) [patch] downsampling slinear16 to slinear (or ulaw or alaw or g729) results in truncation
Alexander Traud (JIRA)
noreply at issues.asterisk.org
Mon Nov 27 08:44:07 CST 2017
[ https://issues.asterisk.org/jira/browse/ASTERISK-16633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=240289#comment-240289 ]
Alexander Traud commented on ASTERISK-16633:
--------------------------------------------
Mhm. Found this issue by browsing. I am not able to reproduce with my Asterisk 13.18. For me, the amount of samples were fine in both directions. Furthermore, nobody watches this issue anymore.
[~russell], is is possible to get a copy of your unit test?
> [patch] downsampling slinear16 to slinear (or ulaw or alaw or g729) results in truncation
> -----------------------------------------------------------------------------------------
>
> Key: ASTERISK-16633
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-16633
> Project: Asterisk
> Issue Type: Bug
> Components: Codecs/General
> Reporter: Paul Albrecht
> Severity: Minor
> Attachments: test_translate.c
>
>
> When I translate from AST_FORMAT_SLINEAR16 to AST_FORMAT_SLINEAR the output frame is truncated, specifically, instead of 160 samples I get 137 samples. The result is the same for ulaw and alaw. For g729, the output is truncated to 80 samples.
> ****** ADDITIONAL INFORMATION ******
> Here's how I initialize the frame I use for translation:
> static struct ast_frame f;
> static unsigned char data[AST_FRIENDLY_OFFSET + 640];
> f.data.ptr = (void *)(data + AST_FRIENDLY_OFFSET);
> f.frametype = AST_FRAME_VOICE;
> f.subclass = AST_FORMAT_SLINEAR16;
> f.samples = 320;
> f.offset = AST_FRIENDLY_OFFSET;
> f.datalen = 640;
> Here's how I translate the frame:
> trans = ast_translator_build_path(AST_FORMAT_SLINEAR,AST_FORMAT_SLINEAR16);
> out = ast_translate(trans,f,0)
> Here's how I log the result:
> ast_log( LOG_NOTICE, "my output frame: subclass %d, samples %d, offset %d, datalen %d\n", out->subclass, out->samples, out->offset,out->datalen) ;
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list