From: Steinar H. Gunderson Date: Sat, 21 Apr 2018 11:03:11 +0000 (+0200) Subject: Fix an issue where video inputs could send invalid Y'CbCr settings. X-Git-Tag: 1.7.2~34 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b69be60c0f8f427ab67426ab326c20336f71395d;p=nageru 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. --- 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);