Commit 89c64402 authored by Yann Diorcet's avatar Yann Diorcet
Browse files

Drawdib force to clean the view at unprepare

parent 3acaa737
......@@ -32,6 +32,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <vfw.h>
static void draw_background(HDC hdc, MSVideoSize wsize, MSRect mainrect, int color[3]);
static void erase_window(HWND window, int color[3]);
typedef struct Yuv2RgbCtx{
uint8_t *rgb;
size_t rgblen;
......@@ -253,6 +256,9 @@ static void dd_display_prepare(MSFilter *f){
static void dd_display_unprepare(MSFilter *f){
DDDisplay *dd=(DDDisplay*)f->data;
if(dd->window!=NULL) {
erase_window(dd->window, dd->background_color);
if (dd->own_window && dd->window!=NULL){
......@@ -282,6 +288,24 @@ static void draw_local_view_frame(HDC hdc, MSVideoSize wsize, MSRect localrect){
localrect.x+localrect.w+LOCAL_BORDER_SIZE, localrect.y+localrect.h+LOCAL_BORDER_SIZE);
static void erase_window(HWND window, int color[3]) {
HDC hdc=GetDC(window);
RECT rect;
MSVideoSize wsize;
MSRect mainrect;
if (hdc==NULL) {
ms_error("Could not get window dc");
// Force to draw background
GetClientRect(window, &rect);
wsize.width = rect.right;
wsize.height = rect.bottom;
memset(&mainrect, 0, sizeof(MSRect));
draw_background(hdc, wsize, mainrect, color);
* Draws a background, that is the black rectangles at top, bottom or left right sides of the video display.
* It is normally invoked only when a full redraw is needed (notified by Windows).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment