diff options
author | ulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-12-08 02:57:50 +0000 |
---|---|---|
committer | ulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-12-08 02:57:50 +0000 |
commit | 1e53a65bf686518de767067d237d8e3034ff24c8 (patch) | |
tree | c8be4b86521a8bcbefb1879b5564de42c1a48aad /libao2 | |
parent | fad92e57fa9826ca461456011633894cd0860aa4 (diff) | |
download | mpv-1e53a65bf686518de767067d237d8e3034ff24c8.tar.bz2 mpv-1e53a65bf686518de767067d237d8e3034ff24c8.tar.xz |
Remove useless variable aoIsCreated since we took good care of init failure.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25318 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r-- | libao2/ao_macosx.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libao2/ao_macosx.c b/libao2/ao_macosx.c index 0a47b77473..834d9f93c0 100644 --- a/libao2/ao_macosx.c +++ b/libao2/ao_macosx.c @@ -296,13 +296,12 @@ AURenderCallbackStruct renderCallback; OSStatus err; UInt32 size, maxFrames, i_param_size; char *psz_name; -int aoIsCreated = ao != NULL; AudioDeviceID devid_def = 0; int b_alive; ao_msg(MSGT_AO,MSGL_V, "init([%dHz][%dch][%s][%d])\n", rate, channels, af_fmt2str_short(format), flags); - if (!aoIsCreated) { ao = malloc(sizeof(ao_macosx_t)); ao->buffer = NULL;} + ao = calloc(1, sizeof(ao_macosx_t)); ao->i_selected_dev = 0; ao->b_supports_digital = 0; @@ -497,8 +496,7 @@ int b_alive; ao->num_chunks = (ao_data.bps+ao->chunk_size-1)/ao->chunk_size; ao->buffer_len = (ao->num_chunks + 1) * ao->chunk_size; - ao->buffer = aoIsCreated ? realloc(ao->buffer,(ao->num_chunks + 1)*ao->chunk_size) - : calloc(ao->num_chunks + 1, ao->chunk_size); + ao->buffer = calloc(ao->num_chunks + 1, ao->chunk_size); ao_msg(MSGT_AO,MSGL_V, "using %5d chunks of %d bytes (buffer len %d bytes)\n", (int)ao->num_chunks, (int)ao->chunk_size, (int)ao->buffer_len); @@ -742,8 +740,7 @@ static int OpenSPDIF() ao->num_chunks = (ao_data.bps+ao->chunk_size-1)/ao->chunk_size; ao->buffer_len = (ao->num_chunks + 1) * ao->chunk_size; - ao->buffer = NULL!=ao->buffer ? realloc(ao->buffer,(ao->num_chunks + 1)*ao->chunk_size) - : calloc(ao->num_chunks + 1, ao->chunk_size); + ao->buffer = calloc(ao->num_chunks + 1, ao->chunk_size); ao_msg(MSGT_AO,MSGL_V, "using %5d chunks of %d bytes (buffer len %d bytes)\n", (int)ao->num_chunks, (int)ao->chunk_size, (int)ao->buffer_len); |