]> git.sesse.net Git - nageru/commitdiff
Fix an issue where video inputs could send invalid Y'CbCr settings.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 21 Apr 2018 11:03:11 +0000 (13:03 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 21 Apr 2018 11:03:11 +0000 (13:03 +0200)
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

index 50b4fa45109362d637dfd69c5122725f69e3828d..8fdb6a58adf38a8a14c771b6b6853c6cea610103 100644 (file)
@@ -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);