mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
res_musiconhold: Start playlist after initial announcement
Only track our sample offset if we are playing a non-announcement file, otherwise we will skip that number of samples when we start playing the first MoH file. ASTERISK-24329 #close Change-Id: Ib6b3c84fcaa1063889ab38ba7e7fc50050a3ccfc
This commit is contained in:
committed by
Friendly Automation
parent
9a62d1fd2a
commit
dde85bae7f
@@ -475,7 +475,12 @@ static int moh_files_generator(struct ast_channel *chan, void *data, int len, in
|
||||
return -1;
|
||||
}
|
||||
|
||||
state->samples += f->samples;
|
||||
/* Only track our offset within the current file if we are not in the
|
||||
* the middle of an announcement */
|
||||
if (!state->announcement) {
|
||||
state->samples += f->samples;
|
||||
}
|
||||
|
||||
state->sample_queue -= f->samples;
|
||||
if (ast_format_cmp(f->subclass.format, state->mohwfmt) == AST_FORMAT_CMP_NOT_EQUAL) {
|
||||
ao2_replace(state->mohwfmt, f->subclass.format);
|
||||
|
Reference in New Issue
Block a user