Commit 35d31acd authored by Jon Lech Johansen's avatar Jon Lech Johansen

* Fixed a problem in the MacOS X aout which caused the previously

    played audio frames to be played when there were no new frames
    available.
  * MacOS X vout now uses the height/width calculated in video_output.c
parent c58149f5
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_macosx.c : CoreAudio output plugin * aout_macosx.c : CoreAudio output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: aout_macosx.c,v 1.15 2002/03/19 03:33:52 jlj Exp $ * $Id: aout_macosx.c,v 1.16 2002/03/22 00:47:47 jlj Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -52,6 +52,7 @@ typedef struct aout_sys_s ...@@ -52,6 +52,7 @@ typedef struct aout_sys_s
Ptr p_buffer; // ptr to the 32 bit float data Ptr p_buffer; // ptr to the 32 bit float data
UInt32 ui_buffer_size; // audio device buffer size UInt32 ui_buffer_size; // audio device buffer size
boolean_t b_buffer_data; // available buffer data?
vlc_mutex_t mutex_lock; // pthread locks for sync of vlc_mutex_t mutex_lock; // pthread locks for sync of
vlc_cond_t cond_sync; // aout_Play and callback vlc_cond_t cond_sync; // aout_Play and callback
} aout_sys_t; } aout_sys_t;
...@@ -283,10 +284,15 @@ static OSStatus CAIOCallback( AudioDeviceID inDevice, ...@@ -283,10 +284,15 @@ static OSStatus CAIOCallback( AudioDeviceID inDevice,
vlc_cond_signal( &p_sys->cond_sync ); vlc_cond_signal( &p_sys->cond_sync );
/* move data into output data buffer */ /* move data into output data buffer */
if( p_sys->b_buffer_data )
{
BlockMoveData( p_sys->p_buffer, BlockMoveData( p_sys->p_buffer,
outOutputData->mBuffers[ 0 ].mData, outOutputData->mBuffers[ 0 ].mData,
p_sys->ui_buffer_size ); p_sys->ui_buffer_size );
p_sys->b_buffer_data = 0;
}
vlc_mutex_unlock( &p_sys->mutex_lock ); vlc_mutex_unlock( &p_sys->mutex_lock );
return( noErr ); return( noErr );
...@@ -309,6 +315,10 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size ) ...@@ -309,6 +315,10 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{ {
intf_ErrMsg( "aout error: ConvertBuffer failed: %d", err ); intf_ErrMsg( "aout error: ConvertBuffer failed: %d", err );
} }
else
{
p_aout->p_sys->b_buffer_data = 1;
}
/* /*
* wait for a callback to occur (to flush the buffer), so aout_Play * wait for a callback to occur (to flush the buffer), so aout_Play
......
...@@ -118,8 +118,9 @@ static int vout_Create( vout_thread_t *p_vout ) ...@@ -118,8 +118,9 @@ static int vout_Create( vout_thread_t *p_vout )
p_vout->p_sys->b_mouse_pointer_visible = 1; p_vout->p_sys->b_mouse_pointer_visible = 1;
p_vout->p_sys->s_rect.size.width = p_vout->render.i_width; /* set window size */
p_vout->p_sys->s_rect.size.height = p_vout->render.i_height; p_vout->p_sys->s_rect.size.width = p_vout->i_window_width;
p_vout->p_sys->s_rect.size.height = p_vout->i_window_height;
if( ( err = EnterMovies() ) != noErr ) if( ( err = EnterMovies() ) != noErr )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment