Merge commit '750917f7ea9876d7a97f48aa4b22097fcf7958d9'
This commit is contained in:
commit
4eeb0858e4
@ -159,7 +159,7 @@ update_if_album_art(const char *path)
|
||||
}
|
||||
|
||||
char *
|
||||
check_embedded_art(const char *path, const char *image_data, int image_size)
|
||||
check_embedded_art(const char *path, uint8_t *image_data, int image_size)
|
||||
{
|
||||
int width = 0, height = 0;
|
||||
char *art_path = NULL;
|
||||
@ -346,7 +346,7 @@ found_file:
|
||||
}
|
||||
|
||||
int64_t
|
||||
find_album_art(const char *path, const char *image_data, int image_size)
|
||||
find_album_art(const char *path, uint8_t *image_data, int image_size)
|
||||
{
|
||||
char *album_art = NULL;
|
||||
int64_t ret = 0;
|
||||
|
@ -24,10 +24,7 @@
|
||||
#ifndef __ALBUMART_H__
|
||||
#define __ALBUMART_H__
|
||||
|
||||
void
|
||||
update_if_album_art(const char *path);
|
||||
|
||||
int64_t
|
||||
find_album_art(const char *path, const char *image_data, int image_size);
|
||||
void update_if_album_art(const char *path);
|
||||
int64_t find_album_art(const char *path, uint8_t *image_data, int image_size);
|
||||
|
||||
#endif
|
||||
|
@ -424,7 +424,7 @@ image_new(int32_t width, int32_t height)
|
||||
}
|
||||
|
||||
image_s *
|
||||
image_new_from_jpeg(const char * path, int is_file, const char * buf, int size, int scale, int rotate)
|
||||
image_new_from_jpeg(const char *path, int is_file, const uint8_t *buf, int size, int scale, int rotate)
|
||||
{
|
||||
image_s *vimage;
|
||||
FILE *file = NULL;
|
||||
@ -447,7 +447,7 @@ image_new_from_jpeg(const char * path, int is_file, const char * buf, int size,
|
||||
}
|
||||
else
|
||||
{
|
||||
jpeg_memory_src(&cinfo, (const unsigned char *)buf, size);
|
||||
jpeg_memory_src(&cinfo, buf, size);
|
||||
}
|
||||
if( setjmp(setjmp_buffer) )
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ int
|
||||
image_get_jpeg_resolution(const char * path, int * width, int * height);
|
||||
|
||||
image_s *
|
||||
image_new_from_jpeg(const char * path, int is_file, const char * ptr, int size, int scale, int resize);
|
||||
image_new_from_jpeg(const char *path, int is_file, const uint8_t *ptr, int size, int scale, int resize);
|
||||
|
||||
image_s *
|
||||
image_resize(image_s * src_image, int32_t width, int32_t height);
|
||||
|
@ -630,7 +630,7 @@ GetImageMetadata(const char *path, char *name)
|
||||
/* We might need to verify that the thumbnail is 160x160 or smaller */
|
||||
if( ed->size > 12000 )
|
||||
{
|
||||
imsrc = image_new_from_jpeg(NULL, 0, (char *)ed->data, ed->size, 1, ROTATE_NONE);
|
||||
imsrc = image_new_from_jpeg(NULL, 0, ed->data, ed->size, 1, ROTATE_NONE);
|
||||
if( imsrc )
|
||||
{
|
||||
if( (imsrc->width <= 160) && (imsrc->height <= 160) )
|
||||
|
@ -63,11 +63,13 @@ AddMulticastMembership(int s, struct lan_addr_s *iface)
|
||||
#ifdef HAVE_STRUCT_IP_MREQN
|
||||
struct ip_mreqn imr; /* Ip multicast membership */
|
||||
/* setting up imr structure */
|
||||
memset(&imr, '\0', sizeof(imr));
|
||||
imr.imr_multiaddr.s_addr = inet_addr(SSDP_MCAST_ADDR);
|
||||
imr.imr_ifindex = iface->ifindex;
|
||||
#else
|
||||
struct ip_mreq imr; /* Ip multicast membership */
|
||||
/* setting up imr structure */
|
||||
memset(&imr, '\0', sizeof(imr));
|
||||
imr.imr_multiaddr.s_addr = inet_addr(SSDP_MCAST_ADDR);
|
||||
imr.imr_interface.s_addr = iface->addr.s_addr;
|
||||
#endif
|
||||
|
@ -105,7 +105,7 @@ gen_dir_hash(const char *path)
|
||||
return 0;
|
||||
|
||||
|
||||
return DJBHash(dir, len);
|
||||
return DJBHash((uint8_t *)dir, len);
|
||||
}
|
||||
|
||||
int
|
||||
|
6
utils.c
6
utils.c
@ -290,14 +290,14 @@ make_dir(char * path, mode_t mode)
|
||||
|
||||
/* Simple, efficient hash function from Daniel J. Bernstein */
|
||||
unsigned int
|
||||
DJBHash(const char *str, int len)
|
||||
DJBHash(uint8_t *data, int len)
|
||||
{
|
||||
unsigned int hash = 5381;
|
||||
unsigned int i = 0;
|
||||
|
||||
for(i = 0; i < len; str++, i++)
|
||||
for(i = 0; i < len; data++, i++)
|
||||
{
|
||||
hash = ((hash << 5) + hash) + (*str);
|
||||
hash = ((hash << 5) + hash) + (*data);
|
||||
}
|
||||
|
||||
return hash;
|
||||
|
Loading…
x
Reference in New Issue
Block a user