Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 921243
Collapse All | Expand All

(-)a/channels/chan_iax2.c (-4 / +14 lines)
Lines 4158-4166 static void __get_from_jb(const void *p) Link Here
4158
	now.tv_usec += 1000;
4158
	now.tv_usec += 1000;
4159
4159
4160
	ms = ast_tvdiff_ms(now, pvt->rxcore);
4160
	ms = ast_tvdiff_ms(now, pvt->rxcore);
4161
4161
	if (ms >= (next = jb_next(pvt->jb))) {
4162
	voicefmt = ast_format_compatibility_bitfield2format(pvt->voiceformat);
4162
		voicefmt = ast_format_compatibility_bitfield2format(pvt->voiceformat);
4163
	if (voicefmt && ms >= (next = jb_next(pvt->jb))) {
4163
		if (!voicefmt) {
4164
			/* pvt->voiceformat won't be set if we haven't received any voice frames yet.
4165
			 * In this case, fall back to using the format negotiated during call setup,
4166
			 * so we don't stall the jitterbuffer completely. */
4167
			voicefmt = ast_format_compatibility_bitfield2format(pvt->peerformat);
4168
		}
4169
		if (!voicefmt) {
4170
			/* Really shouldn't happen, but if it does, should be looked into */
4171
			ast_log(LOG_WARNING, "No voice format and no peer format available on %s, backlogging frame\n", ast_channel_name(pvt->owner));
4172
			goto cleanup; /* Don't crash if there's no voice format */
4173
		}
4164
		ret = jb_get(pvt->jb, &frame, ms, ast_format_get_default_ms(voicefmt));
4174
		ret = jb_get(pvt->jb, &frame, ms, ast_format_get_default_ms(voicefmt));
4165
		switch(ret) {
4175
		switch(ret) {
4166
		case JB_OK:
4176
		case JB_OK:
Lines 4202-4207 static void __get_from_jb(const void *p) Link Here
4202
			break;
4212
			break;
4203
		}
4213
		}
4204
	}
4214
	}
4215
cleanup:
4205
	if (pvt)
4216
	if (pvt)
4206
		update_jbsched(pvt);
4217
		update_jbsched(pvt);
4207
	ast_mutex_unlock(&iaxsl[callno]);
4218
	ast_mutex_unlock(&iaxsl[callno]);
4208
- 

Return to bug 921243