diff options
Diffstat (limited to 'src/gif.c')
-rw-r--r-- | src/gif.c | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -157,7 +157,8 @@ void *a_Gif_image(const char *Type, void *Ptr, CA_Callback_t *Call, /* * MIME handler for "image/gif" type - * (Sets Gif_callback as cache-client) + * Sets a_Dicache_callback as the cache-client, + * and Gif_callback as the image decoder. */ void *a_Gif_image(const char *Type, void *Ptr, CA_Callback_t *Call, void **Data) @@ -172,20 +173,20 @@ void *a_Gif_image(const char *Type, void *Ptr, CA_Callback_t *Call, /* Add an extra reference to the Image (for dicache usage) */ a_Image_ref(web->Image); - DicEntry = a_Dicache_get_entry(web->url); + DicEntry = a_Dicache_get_entry(web->url, DIC_Last); if (!DicEntry) { /* Let's create an entry for this image... */ DicEntry = a_Dicache_add_entry(web->url); - - /* ... and let the decoder feed it! */ - *Data = Gif_new(web->Image, DicEntry->url, DicEntry->version); - *Call = (CA_Callback_t) Gif_callback; + DicEntry->DecoderData = + Gif_new(web->Image, DicEntry->url, DicEntry->version); } else { - /* Let's feed our client from the dicache */ + /* Repeated image */ a_Dicache_ref(DicEntry->url, DicEntry->version); - *Data = web->Image; - *Call = (CA_Callback_t) a_Dicache_callback; } + DicEntry->Decoder = Gif_callback; + *Data = DicEntry->DecoderData; + *Call = (CA_Callback_t) a_Dicache_callback; + return (web->Image->dw); } @@ -261,7 +262,7 @@ static void Gif_close(DilloGif *gif, CacheClient_t *Client) { int i; - _MSG("destroy gif %p\n", gif); + MSG("Gif_close: destroy gif %p\n", gif); a_Dicache_close(gif->url, gif->version, Client); |