From 8fc3ec638c7e516f4610775488f2e7f40689a68f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 26 Jun 2009 21:22:36 +0100 Subject: [PATCH] Fix stupid black image bug; various other minor fixes --- pctb/TODO | 8 -------- pctb/convert.c | 1 + pctb/pages.c | 16 +++++++--------- pctb/x.gdb | 9 ++++++--- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/pctb/TODO b/pctb/TODO index 36b39fc..33e66e7 100644 --- a/pctb/TODO +++ b/pctb/TODO @@ -3,11 +3,3 @@ write real uploader test real uploader building island name extractor speed it up - -./ypp-commodities -Dpixmap -Drect --test-servers --find-island 2>u - -liberator:pctb> ./ypp-commodities --test-servers --find-island >raw.tsv -found YPP client (0x3200007): Midnight ocean - Eudoxus. -collected 36 screenshots. -Segmentation fault -liberator:pctb> diff --git a/pctb/convert.c b/pctb/convert.c index 21445c5..c79477f 100644 --- a/pctb/convert.c +++ b/pctb/convert.c @@ -283,6 +283,7 @@ int main(int argc, char **argv) { open_screenshot_file("w"); if (o_flags & ff_singlepage) take_one_screenshot(); else take_screenshots(); + progress_log("OK for you to move the mouse now."); } if (o_mode & mf_readscreenshot) { open_screenshot_file("r"); diff --git a/pctb/pages.c b/pctb/pages.c index 32e429a..ca2428d 100644 --- a/pctb/pages.c +++ b/pctb/pages.c @@ -322,15 +322,13 @@ static void wait_for_stability(Snapshot **output, /* waits longer if we're going to return an image identical to previously * if previously==0, all images are considered identical to it */ - debugf("PAGING wait_for_stability" - " last_input=%f previously=%p\n", - last_input, previously); - - char *doing; - sysassert( vasprintf(&doing,fmt,al) >=0); - + char *doing= masprintf(fmt,al); progress("%s",doing); + debugf("PAGING wait_for_stability" + " last_input=%f previously=%p `%s'\n", + last_input, previously, doing); + for (;;) { double at_snapshot= timestamp(); double need_sleep= min_update_allowance - (at_snapshot - last_input); @@ -514,7 +512,7 @@ static void prepare_ypp_client(void) { raise_and_get_details(); wait_for_stability(¤t,0,0, "checking current YPP client screen..."); -#if 1 +#if 0 timestamp(); snapshot(¤t); snapshot(¤t); @@ -596,7 +594,7 @@ void take_one_screenshot(void) { prepare_ypp_client(); wait_for_stability(¤t,0,0, "taking screenshot..."); page0_rgbimage= alloc_rgb_image(current->w, current->h); - page_images[0]= convert_page(current, 0); + page_images[0]= convert_page(current, page0_rgbimage); npages= 1; progress_log("collected single screenshot."); } diff --git a/pctb/x.gdb b/pctb/x.gdb index c6d2387..5adf557 100644 --- a/pctb/x.gdb +++ b/pctb/x.gdb @@ -1,5 +1,8 @@ file ypp-commodities -set confirm off -set args -Dcallout --ocean midnight --pirate aristarchus --same --raw-tsv >raw.tsv -break convert.c:260 +set args -Dpages --test-servers --find-island +break pages.c:596 + +#set args -Dcallout --ocean midnight --pirate aristarchus --same --raw-tsv >raw.tsv +#break convert.c:260 + run -- 2.30.2