X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg_capture.cpp;h=235393a5058b0a2215a8ea021becc6c1fc75ab9a;hb=a5746714e6ca1e665bf9e74344e67712443f947a;hp=b7db50c5513beea1376b70031d608cab6059c154;hpb=4d4386716f258413132b8696315cb4efbf2c8b45;p=nageru diff --git a/ffmpeg_capture.cpp b/ffmpeg_capture.cpp index b7db50c..235393a 100644 --- a/ffmpeg_capture.cpp +++ b/ffmpeg_capture.cpp @@ -327,6 +327,7 @@ void FFmpegCapture::send_disconnected_frame() if (pixel_format == bmusb::PixelFormat_8BitBGRA) { video_format.stride = width * 4; video_frame.len = width * height * 4; + memset(video_frame.data, 0, video_frame.len); } else { video_format.stride = width; current_frame_ycbcr_format.luma_coefficients = YCBCR_REC_709; @@ -339,8 +340,9 @@ void FFmpegCapture::send_disconnected_frame() 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, width * height); + memset(video_frame.data + width * height, 128, width * height); // Valid for both NV12 and planar. } - memset(video_frame.data, 0, video_frame.len); frame_callback(-1, AVRational{1, TIMEBASE}, -1, AVRational{1, TIMEBASE}, timecode++, video_frame, /*video_offset=*/0, video_format,