[Asterisk-code-review] translate: Fix transcoding while different in frame size. (asterisk[13])

Richard Mudgett asteriskteam at digium.com
Tue Sep 15 14:44:47 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: translate: Fix transcoding while different in frame size.
......................................................................


Patch Set 6: Code-Review-1

(2 comments)

I'm very concerned about the callers of ast_translate() being able to handle a list of frames being returned.  Before this patch, ast_translate() never actually returned a list of frames despite what a comment in __ast_read() states.  With this patch, ast_translate() is now likely to return multiple frames when the affected gsm, ilbc, lpc10, and speex codecs are involved.

Users of audio hooks in particular may have an issue with the list of frames returned.

https://gerrit.asterisk.org/#/c/1155/6/main/translate.c
File main/translate.c:

Line 551: 		framein(p, out);
framein() needs to be put in a loop for each frame or made to handle a list of frames since out can now become a list of frames by the previous call to p->t->frameout() in the for loop.


Multi-step translation paths do exist.


Line 576: 				} else {
        : 					path->nextout = ast_tvadd(path->nextout, ast_samp2tv(
        : 						current->samples, ast_format_get_sample_rate(current->subclass.format)));
        : 				}
        : 
        : 				if (f->samples != current->samples && ast_test_flag(current, AST_FRFLAG_HAS_TIMING_INFO)) {
        : 					ast_debug(4, "Sample size different %d vs %d\n", f->samples, current->samples);
        : 					ast_clear_flag(current, AST_FRFLAG_HAS_TIMING_INFO);
        : 				}
The if (f->samples... code needs to be part of the else clause since that is dealing with a frame containing samples and not an AST_FRAME_CNG.


-- 
To view, visit https://gerrit.asterisk.org/1155
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2e229569d73191d66a4e43fef35432db24000212
Gerrit-PatchSet: 6
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list