* Make JPEG resolution parsing work properly on big-endian systems.
This commit is contained in:
parent
a26802539f
commit
516b025eca
@ -235,7 +235,7 @@ image_get_jpeg_resolution(const char * path, int * width, int * height)
|
|||||||
{
|
{
|
||||||
FILE *img;
|
FILE *img;
|
||||||
unsigned char buf[8];
|
unsigned char buf[8];
|
||||||
u_int16_t offset;
|
u_int16_t offset, h, w;
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
img = fopen(path, "r");
|
img = fopen(path, "r");
|
||||||
@ -263,10 +263,10 @@ image_get_jpeg_resolution(const char * path, int * width, int * height)
|
|||||||
fread(&buf, 7, 1, img);
|
fread(&buf, 7, 1, img);
|
||||||
*width = 0;
|
*width = 0;
|
||||||
*height = 0;
|
*height = 0;
|
||||||
memcpy(height, buf+3, 2);
|
memcpy(&h, buf+3, 2);
|
||||||
*height = SWAP16(*height);
|
*height = SWAP16(h);
|
||||||
memcpy(width, buf+5, 2);
|
memcpy(&w, buf+5, 2);
|
||||||
*width = SWAP16(*width);
|
*width = SWAP16(w);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -968,7 +968,7 @@ GetVideoMetadata(const char * path, char * name)
|
|||||||
else if( strcmp(ctx->iformat->name, "flv") == 0 )
|
else if( strcmp(ctx->iformat->name, "flv") == 0 )
|
||||||
asprintf(&m.mime, "video/x-flv");
|
asprintf(&m.mime, "video/x-flv");
|
||||||
else
|
else
|
||||||
DPRINTF(E_WARN, L_METADATA, "Unhandled format: %s\n", ctx->iformat->name);
|
DPRINTF(E_WARN, L_METADATA, "%s: Unhandled format: %s\n", path, ctx->iformat->name);
|
||||||
}
|
}
|
||||||
av_close_input_file(ctx);
|
av_close_input_file(ctx);
|
||||||
#ifdef TIVO_SUPPORT
|
#ifdef TIVO_SUPPORT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user