switch_size_t mux_buf_len;
switch_time_t last_vid_write;
+ int audio_timer;
};
typedef struct av_file_context av_file_context_t;
context->seek_ts = -1;
context->offset = DFT_RECORD_OFFSET;
context->handle = handle;
-
+ context->audio_timer = 1;
+
if (handle->params) {
if ((tmp = switch_event_get_header(handle->params, "av_video_offset"))) {
context->offset = atoi(tmp);
}
+ if ((tmp = switch_event_get_header(handle->params, "video_time_audio"))) {
+ if (tmp && switch_false(tmp)) {
+ context->audio_timer = 0;
+ }
+ }
}
switch_mutex_init(&context->mutex, SWITCH_MUTEX_NESTED, handle->memory_pool);
delta = context->video_timer.samplecount - context->last_vid_write;
- if (delta >= 60) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Video timer sync: %ld/%d %ld\n", context->audio_st[0].next_pts, context->video_timer.samplecount, context->audio_st[0].next_pts- context->video_timer.samplecount);
- sample_start = context->video_timer.samplecount * (handle->samplerate / 1000);
+ if (context->audio_timer || delta >= 60) {
+ uint32_t new_pts = context->video_timer.samplecount * (handle->samplerate / 1000);
+ if (!context->audio_timer) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Delta of %d detected. Video timer sync: %ld/%d %ld\n", delta, context->audio_st[0].next_pts, context->video_timer.samplecount, new_pts - context->audio_st[0].next_pts);
+ }
+ sample_start = new_pts;
}
context->last_vid_write = context->video_timer.samplecount;
flags |= SWITCH_FILE_FLAG_VIDEO;
if (canvas) {
- rec->path = switch_core_sprintf(rec->pool, "{channels=%d,samplerate=%d,vw=%d,vh=%d,fps=%0.2f}%s",
+ rec->path = switch_core_sprintf(rec->pool, "{video_time_audio=false,channels=%d,samplerate=%d,vw=%d,vh=%d,fps=%0.2f}%s",
conference->channels,
conference->rate,
canvas->width,
conference->video_fps.fps,
orig_path);
} else {
- rec->path = switch_core_sprintf(rec->pool, "{channels=%d,samplerate=%d,vw=%d,vh=%d,fps=%0.2f}%s",
+ rec->path = switch_core_sprintf(rec->pool, "{video_time_audio=false,channels=%d,samplerate=%d,vw=%d,vh=%d,fps=%0.2f}%s",
conference->channels,
conference->rate,
conference->canvas_width,
return SWITCH_STATUS_FALSE;
}
+ switch_mutex_lock(canvas->mutex);
+
+ layer = &canvas->layers[idx];
+
+ layer->tagged = 0;
+
if (!zstr(member->video_role_id) && !zstr(layer->geometry.role_id) && !strcmp(layer->geometry.role_id, member->video_role_id)) {
conference_utils_member_set_flag(member, MFLAG_DED_VID_LAYER);
}
}
}
- switch_mutex_lock(canvas->mutex);
-
- layer = &canvas->layers[idx];
-
- layer->tagged = 0;
-
if (layer->fnode || layer->geometry.fileonly) {
switch_goto_status(SWITCH_STATUS_FALSE, end);
}