diff --git a/metadata.c b/metadata.c
index 0e53772..8764aa6 100644
--- a/metadata.c
+++ b/metadata.c
@@ -356,7 +356,7 @@ GetImageMetadata(const char * path, char * name)
else
return 0;
strip_ext(name);
- //DEBUG DPRINTF(E_DEBUG, L_METADATA, " * size: %d\n", size);
+ //DEBUG DPRINTF(E_DEBUG, L_METADATA, " * size: %jd\n", size);
/* MIME hard-coded to JPEG for now, until we add PNG support */
asprintf(&m.mime, "image/jpeg");
@@ -474,7 +474,7 @@ no_exifdata:
sql = sqlite3_mprintf( "INSERT into DETAILS"
" (PATH, TITLE, SIZE, DATE, RESOLUTION, THUMBNAIL, CREATOR, DLNA_PN, MIME) "
"VALUES"
- " (%Q, '%q', %llu, %Q, %Q, %d, %Q, %Q, %Q);",
+ " (%Q, '%q', %jd, %Q, %Q, %d, %Q, %Q, %Q);",
path, name, size, date, m.resolution, thumb, cam, m.dlna_pn, m.mime);
//DEBUG DPRINTF(E_DEBUG, L_METADATA, "SQL: %s\n", sql);
if( sql_exec(db, sql) != SQLITE_OK )
@@ -529,7 +529,7 @@ GetVideoMetadata(const char * path, char * name)
size = file.st_size;
}
strip_ext(name);
- //DEBUG DPRINTF(E_DEBUG, L_METADATA, " * size: %d\n", size);
+ //DEBUG DPRINTF(E_DEBUG, L_METADATA, " * size: %jd\n", size);
av_register_all();
if( av_open_input_file(&ctx, path, NULL, 0, NULL) != 0 )
@@ -908,7 +908,7 @@ GetVideoMetadata(const char * path, char * name)
" (PATH, SIZE, DURATION, DATE, CHANNELS, BITRATE, SAMPLERATE, RESOLUTION,"
" CREATOR, TITLE, DLNA_PN, MIME, ALBUM_ART, ART_DLNA_PN) "
"VALUES"
- " (%Q, %lld, %Q, %Q, %Q, %Q, %Q, %Q, %Q, '%q', %Q, '%q', %lld, %Q);",
+ " (%Q, %jd, %Q, %Q, %Q, %Q, %Q, %Q, %Q, '%q', %Q, '%q', %lld, %Q);",
path, size, m.duration,
strlen(date) ? date : NULL,
m.channels, m.bitrate, m.frequency, m.resolution,
diff --git a/tivo_commands.c b/tivo_commands.c
index ac2037b..0eb9cc1 100644
--- a/tivo_commands.c
+++ b/tivo_commands.c
@@ -203,9 +203,10 @@ int callback(void *args, int argc, char **argv, char **azColName)
passed_args->size += ret;
}
if( resolution ) {
- ret = sprintf(str_buf, "%.*s"
+ char *width = strsep(&resolution, "x");
+ ret = sprintf(str_buf, "%s"
"%s",
- (index(resolution, 'x')-resolution), resolution, (rindex(resolution, 'x')+1));
+ width, resolution);
memcpy(passed_args->resp+passed_args->size, &str_buf, ret+1);
passed_args->size += ret;
}
diff --git a/upnpdescgen.c b/upnpdescgen.c
index 85789a7..543e8d9 100644
--- a/upnpdescgen.c
+++ b/upnpdescgen.c
@@ -534,7 +534,7 @@ static char *
genXML(char * str, int * len, int * tmplen,
const struct XMLElt * p)
{
- unsigned short i, j, k;
+ u_int16_t i, j, k;
int top;
const char * eltname, *s;
char c;
@@ -602,8 +602,8 @@ genXML(char * str, int * len, int * tmplen,
k = i;
/*i = p[k].index; */
/*j = i + p[k].nchild; */
- i = (unsigned)p[k].data & 0xffff;
- j = i + ((unsigned)p[k].data >> 16);
+ i = (unsigned long)p[k].data & 0xffff;
+ j = i + ((unsigned long)p[k].data >> 16);
top++;
#ifdef DESC_DEBUG
printf("DBG: +pile[%d]\t%d %d\n", top, i, j);
diff --git a/upnphttp.c b/upnphttp.c
index 89708bc..426d463 100644
--- a/upnphttp.c
+++ b/upnphttp.c
@@ -1113,7 +1113,6 @@ SendResp_albumArt(struct upnphttp * h, char * object)
if( dash )
*dash = '\0';
sprintf(sql_buf, "SELECT PATH from ALBUM_ART where ID = %s", object);
-printf("sql: %s\n", sql_buf);
sql_get_table(db, sql_buf, &result, &rows, NULL);
if( !rows )
{
@@ -1138,7 +1137,7 @@ printf("sql: %s\n", sql_buf);
sprintf(header, "HTTP/1.1 200 OK\r\n"
"Content-Type: image/jpeg\r\n"
- "Content-Length: %lld\r\n"
+ "Content-Length: %jd\r\n"
"Connection: close\r\n"
"Date: %s\r\n"
"EXT:\r\n"
@@ -1547,16 +1546,16 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
if( h->req_RangeEnd < size )
{
total = h->req_RangeEnd - h->req_RangeStart + 1;
- sprintf(hdr_buf, "Content-Length: %llu\r\n"
- "Content-Range: bytes %lld-%lld/%llu\r\n",
+ sprintf(hdr_buf, "Content-Length: %jd\r\n"
+ "Content-Range: bytes %jd-%jd/%jd\r\n",
total, h->req_RangeStart, h->req_RangeEnd, size);
}
else
{
h->req_RangeEnd = size;
total = size - h->req_RangeStart;
- sprintf(hdr_buf, "Content-Length: %llu\r\n"
- "Content-Range: bytes %lld-%llu/%llu\r\n",
+ sprintf(hdr_buf, "Content-Length: %jd\r\n"
+ "Content-Range: bytes %jd-%jd/%jd\r\n",
total, h->req_RangeStart, size-1, size);
}
}
@@ -1564,7 +1563,7 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
{
h->req_RangeEnd = size;
total = size;
- sprintf(hdr_buf, "Content-Length: %llu\r\n", total);
+ sprintf(hdr_buf, "Content-Length: %jd\r\n", total);
}
strcat(header, hdr_buf);
diff --git a/upnphttp.h b/upnphttp.h
index fdcfee5..c26a3c3 100644
--- a/upnphttp.h
+++ b/upnphttp.h
@@ -51,8 +51,8 @@ struct upnphttp {
int req_Timeout;
const char * req_SID; /* For UNSUBSCRIBE */
int req_SIDLen;
- long long int req_RangeStart;
- long long int req_RangeEnd;
+ off_t req_RangeStart;
+ off_t req_RangeEnd;
long int req_chunklen;
u_int32_t reqflags;
int respflags;