vcap/file: missing lock

When playing single JPEG, the s->video_frame_queue got corrupted (.size()
returned UINT_MAX).
This commit is contained in:
Martin Pulec
2025-10-01 11:59:12 +02:00
parent a5067c367b
commit 8c19440aa4

View File

@@ -168,6 +168,7 @@ static void vidcap_file_show_help(bool full) {
}
static void flush_captured_data(struct vidcap_state_lavf_decoder *s) {
pthread_mutex_lock(&s->lock);
struct video_frame *f = NULL;
while ((f = simple_linked_list_pop(s->video_frame_queue)) != NULL) {
VIDEO_FRAME_DISPOSE(f);
@@ -185,6 +186,7 @@ static void flush_captured_data(struct vidcap_state_lavf_decoder *s) {
avcodec_flush_buffers(s->aud_ctx);
}
s->audio_end_ts = AV_NOPTS_VALUE;
pthread_mutex_unlock(&s->lock);
}
static void vidcap_file_common_cleanup(struct vidcap_state_lavf_decoder *s) {