]> git.sesse.net Git - vlc/blobdiff - src/audio_output/common.c
Make aout_buffer_t an alias for block_t
[vlc] / src / audio_output / common.c
index 8647c7702a98a6355a5db093f97d3880b47d49c1..62b11e8cc84b61eccfaa21765be03cb965966af9 100644 (file)
@@ -707,18 +707,8 @@ aout_buffer_t *aout_BufferAlloc(aout_alloc_t *allocation, mtime_t microseconds,
         return old_buffer;
     }
 
-    aout_buffer_t *buffer;
-    int i_alloc_size;
-
-    i_alloc_size = (int)( (uint64_t)allocation->i_bytes_per_sec
+    size_t i_alloc_size = (int)( (uint64_t)allocation->i_bytes_per_sec
                                         * (microseconds) / 1000000 + 1 );
 
-    buffer = malloc( i_alloc_size + sizeof(aout_buffer_t) );
-    if ( !buffer )
-        return NULL;
-
-    buffer->i_size = i_alloc_size;
-    buffer->p_buffer = (uint8_t *)buffer + sizeof(aout_buffer_t);
-    buffer->i_flags = 0;
-    return buffer;
+    return block_Alloc( i_alloc_size );
 }