169c169 < static struct ast_frame *audiohook_read_frame_single(struct ast_audiohook *audiohook, size_t samples, enum ast_audiohook_direction direction, int format) --- > static struct ast_frame *audiohook_read_frame_single(struct ast_audiohook *audiohook, size_t samples, enum ast_audiohook_direction direction) 181,183c181 < if(ast_format_rate(format) == 16000) { < frame.subclass = AST_FORMAT_SLINEAR16; < } --- > 199c197 < static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audiohook, size_t samples, int format) --- > static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audiohook, size_t samples) 210,212c208 < if(ast_format_rate(format) == 16000) { < frame.subclass = AST_FORMAT_SLINEAR16; < } --- > 303c299 < if (!(read_frame = (direction == AST_AUDIOHOOK_DIRECTION_BOTH ? audiohook_read_frame_both(audiohook, samples, format) : audiohook_read_frame_single(audiohook, samples, direction, format)))) --- > if (!(read_frame = (direction == AST_AUDIOHOOK_DIRECTION_BOTH ? audiohook_read_frame_both(audiohook, samples) : audiohook_read_frame_single(audiohook, samples, direction)))) 307c303 < if (format != read_frame->subclass) { --- > if (format != AST_FORMAT_SLINEAR) { 315c311 < if (!(audiohook->trans_pvt = ast_translator_build_path(format, read_frame->subclass))) { --- > if (!(audiohook->trans_pvt = ast_translator_build_path(format, AST_FORMAT_SLINEAR))) { 319d314 < audiohook->format = format; 593a589 > 599,605c595,596 < if(ast_format_rate(frame->subclass) == 16000) { < if (!(in_translate->trans_pvt = ast_translator_build_path(AST_FORMAT_SLINEAR16, frame->subclass))) < return frame; < } else { < if (!(in_translate->trans_pvt = ast_translator_build_path(AST_FORMAT_SLINEAR, frame->subclass))) < return frame; < } --- > if (!(in_translate->trans_pvt = ast_translator_build_path(AST_FORMAT_SLINEAR, frame->subclass))) > return frame; 686,697c677,680 < if(ast_format_rate(frame->subclass) == 16000) { < if (!(out_translate->trans_pvt = ast_translator_build_path(start_frame->subclass, AST_FORMAT_SLINEAR16))) { < /* We can't transcode this... drop our middle frame and return the original */ < ast_frfree(middle_frame); < return start_frame; < } < } else { < if (!(out_translate->trans_pvt = ast_translator_build_path(start_frame->subclass, AST_FORMAT_SLINEAR))) { < /* We can't transcode this... drop our middle frame and return the original */ < ast_frfree(middle_frame); < return start_frame; < } --- > if (!(out_translate->trans_pvt = ast_translator_build_path(start_frame->subclass, AST_FORMAT_SLINEAR))) { > /* We can't transcode this... drop our middle frame and return the original */ > ast_frfree(middle_frame); > return start_frame;