From b69be60c0f8f427ab67426ab326c20336f71395d Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 21 Apr 2018 13:03:11 +0200 Subject: [PATCH] Fix an issue where video inputs could send invalid Y'CbCr settings. This would happen in the case where we had never sent a valid frame (so we hadn't set luma coefficients) but wanted to send a disconnect frame, tripping up a Movit assert. --- ffmpeg_capture.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ffmpeg_capture.cpp b/ffmpeg_capture.cpp index 50b4fa4..8fdb6a5 100644 --- a/ffmpeg_capture.cpp +++ b/ffmpeg_capture.cpp @@ -322,10 +322,15 @@ void FFmpegCapture::send_disconnected_frame() video_frame.len = width * height * 4; } else { video_format.stride = width; + current_frame_ycbcr_format.luma_coefficients = YCBCR_REC_709; current_frame_ycbcr_format.full_range = true; current_frame_ycbcr_format.num_levels = 256; current_frame_ycbcr_format.chroma_subsampling_x = 2; current_frame_ycbcr_format.chroma_subsampling_y = 2; + current_frame_ycbcr_format.cb_x_position = 0.0f; + current_frame_ycbcr_format.cb_y_position = 0.0f; + current_frame_ycbcr_format.cr_x_position = 0.0f; + current_frame_ycbcr_format.cr_y_position = 0.0f; video_frame.len = width * height * 2; } memset(video_frame.data, 0, video_frame.len); -- 2.39.2