mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-20 17:40:12 +00:00
vidcap file: flush decoder context on seek
Also check if ring_buffer is available before flushing it, it crashes without audio.
This commit is contained in:
@@ -158,7 +158,15 @@ static void flush_captured_data(struct vidcap_state_lavf_decoder *s) {
|
||||
while ((f = simple_linked_list_pop(s->video_frame_queue)) != NULL) {
|
||||
VIDEO_FRAME_DISPOSE(f);
|
||||
}
|
||||
ring_buffer_flush(s->audio_data);
|
||||
if (s->audio_data) {
|
||||
ring_buffer_flush(s->audio_data);
|
||||
}
|
||||
if (s->vid_ctx) {
|
||||
avcodec_flush_buffers(s->vid_ctx);
|
||||
}
|
||||
if (s->aud_ctx) {
|
||||
avcodec_flush_buffers(s->aud_ctx);
|
||||
}
|
||||
}
|
||||
|
||||
static void vidcap_file_common_cleanup(struct vidcap_state_lavf_decoder *s) {
|
||||
|
||||
Reference in New Issue
Block a user