Commit ee9032de authored by Mikhail Karpenko's avatar Mikhail Karpenko

Get update period for interface from status output

parent 8efb3a01
......@@ -270,7 +270,7 @@ int camogm_start_jpeg(camogm_state *state)
}
offset = lba_to_offset(state->writer_params.lba_current - state->writer_params.lba_start);
lseek64(state->writer_params.blockdev_fd, offset, SEEK_SET);
D6(fprintf(debug_file, "Open block device: %s, offset in bytes: %llu\n", state->rawdev.rawdev_path, offset));
D3(fprintf(debug_file, "Open block device: %s, offset in bytes: %llu\n", state->rawdev.rawdev_path, offset));
state->writer_params.stat_update = time(NULL);
}
......
......@@ -414,6 +414,21 @@ function process_recording(xmldoc) {
if (state=='"stopped"'){
clearInterval(update_intvl);
} else {
var frame_period = 0;
var rates = xmldoc.getElementsByTagName('frame_period');
for (var i = 0; i < rates.length; i++) {
var data = parseInt(rates[i].firstChild.data);
if (data > frame_period)
frame_period = data;
}
if (frame_period != 0) {
frame_period /= 1000;
} else {
frame_period = 1000;
}
clearInterval(update_intvl);
update_intvl = setInterval(update_state, frame_period);
}
//Update HTML
document.getElementById('ajax_state').innerHTML = state.substring(1, state.length-1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment