Fix bug: Grabbing JPG image fails while suspended.

This commit is contained in:
Johns 2012-02-19 20:52:57 +01:00
parent 98f73f2199
commit c4ad13c53f
2 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,7 @@
User johns User johns
Date: Date:
Fix bug: Grabbing a JPG image fails while suspended.
Add support for hot keys. Add support for hot keys.
Add support to use characters input in edit mode. Add support to use characters input in edit mode.
Adds trick speed support. Adds trick speed support.

View File

@ -1186,15 +1186,20 @@ uint8_t *CreateJpeg(uint8_t * image, int raw_size, int *size, int quality,
uint8_t *GrabImage(int *size, int jpeg, int quality, int width, int height) uint8_t *GrabImage(int *size, int jpeg, int quality, int width, int height)
{ {
if (jpeg) { if (jpeg) {
uint8_t *jpg_image;
uint8_t *image; uint8_t *image;
int raw_size = 0; int raw_size;
raw_size = 0;
image = VideoGrab(&raw_size, &width, &height, 0); image = VideoGrab(&raw_size, &width, &height, 0);
jpg_image = CreateJpeg(image, size, quality, width, height); if (image) { // can fail, suspended, ...
uint8_t *jpg_image;
free(image); jpg_image = CreateJpeg(image, size, quality, width, height);
return jpg_image;
free(image);
return jpg_image;
}
return NULL;
} }
if (width != -1 && height != -1) { if (width != -1 && height != -1) {
Warning(_("softhddev: scaling unsupported\n")); Warning(_("softhddev: scaling unsupported\n"));