mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Fix bug: unscaled jpeg includes PNG header.
This commit is contained in:
parent
0a1a258d2a
commit
56edfd4f54
@ -2,6 +2,15 @@ User johns
|
|||||||
Date:
|
Date:
|
||||||
|
|
||||||
Release Version 0.4.7
|
Release Version 0.4.7
|
||||||
|
|
||||||
|
User FireFly
|
||||||
|
Date: Mon Feb 13 20:14:11 CET 2012
|
||||||
|
|
||||||
|
Fix bug: unscaled jpeg includes PNG header.
|
||||||
|
|
||||||
|
User johns
|
||||||
|
Date: Mon Feb 13 14:58:26 CET 2012
|
||||||
|
|
||||||
VDPAU: Studio levels could be configured in the setup menu.
|
VDPAU: Studio levels could be configured in the setup menu.
|
||||||
Window size defaults to fullscreen, if no geometry is given.
|
Window size defaults to fullscreen, if no geometry is given.
|
||||||
|
|
||||||
|
4
video.c
4
video.c
@ -8678,6 +8678,7 @@ uint8_t *VideoGrab(int *size, int *width, int *height, int write_header)
|
|||||||
|
|
||||||
scale_width = *width;
|
scale_width = *width;
|
||||||
scale_height = *height;
|
scale_height = *height;
|
||||||
|
n = 0;
|
||||||
data = VideoUsedModule->GrabOutput(size, width, height);
|
data = VideoUsedModule->GrabOutput(size, width, height);
|
||||||
|
|
||||||
if (scale_width <= 0) {
|
if (scale_width <= 0) {
|
||||||
@ -8688,7 +8689,6 @@ uint8_t *VideoGrab(int *size, int *width, int *height, int write_header)
|
|||||||
}
|
}
|
||||||
// hardware didn't scale for us, use simple software scaler
|
// hardware didn't scale for us, use simple software scaler
|
||||||
if (scale_width != *width && scale_height != *height) {
|
if (scale_width != *width && scale_height != *height) {
|
||||||
n = 0;
|
|
||||||
if (write_header) {
|
if (write_header) {
|
||||||
n = snprintf(buf, sizeof(buf), "P6\n%d\n%d\n255\n",
|
n = snprintf(buf, sizeof(buf), "P6\n%d\n%d\n255\n",
|
||||||
scale_width, scale_height);
|
scale_width, scale_height);
|
||||||
@ -8730,8 +8730,10 @@ uint8_t *VideoGrab(int *size, int *width, int *height, int write_header)
|
|||||||
|
|
||||||
// grabed image of correct size convert BGRA -> RGB
|
// grabed image of correct size convert BGRA -> RGB
|
||||||
} else {
|
} else {
|
||||||
|
if (write_header) {
|
||||||
n = snprintf(buf, sizeof(buf), "P6\n%d\n%d\n255\n", *width,
|
n = snprintf(buf, sizeof(buf), "P6\n%d\n%d\n255\n", *width,
|
||||||
*height);
|
*height);
|
||||||
|
}
|
||||||
rgb = malloc(*width * *height * 3 + n);
|
rgb = malloc(*width * *height * 3 + n);
|
||||||
if (!rgb) {
|
if (!rgb) {
|
||||||
Error(_("video: out of memory\n"));
|
Error(_("video: out of memory\n"));
|
||||||
|
Loading…
Reference in New Issue
Block a user