Commit c2d76746 authored by Mikhail Karpenko's avatar Mikhail Karpenko

WIP: recover audio stream after buffer overrun

parent d37d4a2f
...@@ -1769,6 +1769,11 @@ int listener_loop(camogm_state *state) ...@@ -1769,6 +1769,11 @@ int listener_loop(camogm_state *state)
} else { } else {
D6(fprintf(debug_file, "not recording audio samples after this frame\n")); D6(fprintf(debug_file, "not recording audio samples after this frame\n"));
} }
// === debug code ===
fprintf(debug_file, "video frames recorded: %d\n", state->frameno);
// ===end of debug ===
audio_process(&state->audio); audio_process(&state->audio);
} }
} }
......
This diff is collapsed.
...@@ -51,6 +51,12 @@ struct context_audio { ...@@ -51,6 +51,12 @@ struct context_audio {
struct timeval time_last; ///< calculated time of last audio sample (this value is not taken from ALSA) struct timeval time_last; ///< calculated time of last audio sample (this value is not taken from ALSA)
long rem_samples; ///< remaining samples long rem_samples; ///< remaining samples
long lost_frames; ///< the number of frames lost after buffer overrun
char *xrun_buffer; ///< temporary storage for the data saved in buffer befor xrun
long xrun_pos; ///< number of samples in xrun buffer
long xrun_append; ///< save in buffer this number of frames after xrun, all other frames in chunk
///< will be silence
snd_pcm_format_t audio_format; ///< format of audio samples as defined in 'enum snd_pcm_format_t' snd_pcm_format_t audio_format; ///< format of audio samples as defined in 'enum snd_pcm_format_t'
snd_pcm_t *capture_hnd; ///< ALSA PCM handle snd_pcm_t *capture_hnd; ///< ALSA PCM handle
}; };
......
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