summaryrefslogtreecommitdiffstats
path: root/libhb/fifo.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2013-11-26 22:12:55 +0000
committerjstebbins <[email protected]>2013-11-26 22:12:55 +0000
commit779fa193b6433f0afadc3fe3c3a6ad72dce54b2c (patch)
tree9f42ecc28232e0043d095d8a0f9eab5bb95d1b47 /libhb/fifo.c
parent58f46542a4d4629050ebc6dfed50f4ec2bcfa0a4 (diff)
libhb: fix a bunch of compiler warnings
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5905 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/fifo.c')
-rw-r--r--libhb/fifo.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/libhb/fifo.c b/libhb/fifo.c
index 6887e43c7..a30d66e9a 100644
--- a/libhb/fifo.c
+++ b/libhb/fifo.c
@@ -8,6 +8,7 @@
*/
#include "hb.h"
+#include "openclwrapper.h"
#ifndef SYS_DARWIN
#include <malloc.h>
@@ -256,7 +257,7 @@ void hb_buffer_pool_free( void )
/* OpenCL */
if (hb_cl_free_mapped_buffer(b->cl.buffer, b->data) == 0)
{
- hb_log("hb_buffer_pool_free: bad free: %.16x -> buffer %.16x map %.16x",
+ hb_log("hb_buffer_pool_free: bad free: %p -> buffer %p map %p",
b, b->cl.buffer, b->data);
}
}
@@ -312,7 +313,8 @@ hb_buffer_t * hb_buffer_init_internal( int size , int needsMapped )
/* OpenCL */
if (b != NULL && needsMapped && b->cl.buffer == NULL)
{
- // We need a mapped OpenCL buffer and that is not what we got out of the pool.
+ // We need a mapped OpenCL buffer and that is not
+ // what we got out of the pool.
// Ditch it; it will get replaced with what we need.
if (b->data != NULL)
{
@@ -374,18 +376,24 @@ hb_buffer_t * hb_buffer_init_internal( int size , int needsMapped )
if (needsMapped)
{
int status = hb_cl_create_mapped_buffer(&b->cl.buffer, &b->data, b->alloc);
+ if (!status)
+ {
+ hb_error("Failed to map CL buffer");
+ free(b);
+ return NULL;
+ }
}
else
{
b->cl.buffer = NULL;
#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined( SYS_MINGW )
- b->data = malloc( b->alloc );
+ b->data = malloc( b->alloc );
#elif defined( SYS_CYGWIN )
- /* FIXME */
- b->data = malloc( b->alloc + 17 );
+ /* FIXME */
+ b->data = malloc( b->alloc + 17 );
#else
- b->data = memalign( 16, b->alloc );
+ b->data = memalign( 16, b->alloc );
#endif
}
@@ -642,7 +650,7 @@ void hb_buffer_close( hb_buffer_t ** _b )
/* OpenCL */
if (hb_cl_free_mapped_buffer(b->cl.buffer, b->data) == 0)
{
- hb_log("hb_buffer_pool_free: bad free %.16x -> buffer %.16x map %.16x",
+ hb_log("hb_buffer_pool_free: bad free %p -> buffer %p map %p",
b, b->cl.buffer, b->data);
}
}