OSDN Git Service

Allow dvd sources that have no audio
[handbrake-jp/handbrake-jp-git.git] / libhb / fifo.c
index 9441f71..48f6459 100644 (file)
@@ -90,8 +90,8 @@ void hb_buffer_pool_free( void )
         }
     }
 
-    hb_deep_log( 2, "Allocated %lld bytes of buffers on this pass and Freed %lld bytes, "
-           "%lld bytes leaked", buffers.allocated, freed, buffers.allocated - freed);
+    hb_deep_log( 2, "Allocated %"PRId64" bytes of buffers on this pass and Freed %"PRId64" bytes, "
+           "%"PRId64" bytes leaked", buffers.allocated, freed, buffers.allocated - freed);
     buffers.allocated = 0;
     hb_unlock(buffers.lock);
 }
@@ -147,7 +147,7 @@ hb_buffer_t * hb_buffer_init( int size )
 
     if (size)
     {
-#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD )
+#if defined( SYS_DARWIN ) || defined( SYS_FREEBSD ) || defined( SYS_MINGW )
         b->data  = malloc( b->alloc );
 #elif defined( SYS_CYGWIN )
         /* FIXME */
@@ -191,6 +191,7 @@ void hb_buffer_close( hb_buffer_t ** _b )
     if( buffer_pool && b->data && !hb_fifo_is_full( buffer_pool ) )
     {
         hb_fifo_push_head( buffer_pool, b );
+        *_b = NULL;
         return;
     }
     /* either the pool is full or this size doesn't use a pool - free the buf */