diff --git a/include/asterisk/translate.h b/include/asterisk/translate.h index 9437fa4e9a..a81d0072ac 100644 --- a/include/asterisk/translate.h +++ b/include/asterisk/translate.h @@ -149,7 +149,7 @@ struct ast_trans_pvt { struct ast_trans_pvt *next; /*!< next in translator chain */ struct timeval nextin; struct timeval nextout; -} attribute_packed; +}; /*! \brief generic frameout function */ struct ast_frame *ast_trans_frameout(struct ast_trans_pvt *pvt, diff --git a/main/frame.c b/main/frame.c index 9ac309fa31..1dafce9f84 100644 --- a/main/frame.c +++ b/main/frame.c @@ -334,6 +334,9 @@ static void frame_cache_cleanup(void *data) void ast_frame_free(struct ast_frame *fr, int cache) { + if (ast_test_flag(fr, AST_FRFLAG_FROM_TRANSLATOR)) + ast_translate_frame_freed(fr); + if (!fr->mallocd) return; @@ -369,9 +372,6 @@ void ast_frame_free(struct ast_frame *fr, int cache) #endif free(fr); } - - if (ast_test_flag(fr, AST_FRFLAG_FROM_TRANSLATOR)) - ast_translate_frame_freed(fr); } /*!