diff options
author | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-12-21 12:56:44 +0000 |
---|---|---|
committer | Miguel Freitas <miguelfreitas@users.sourceforge.net> | 2002-12-21 12:56:44 +0000 |
commit | 5f31761a4fa6995592cdd536c52f6ddac8151a89 (patch) | |
tree | aeec46d8f80b411df280cc2cc6bc124c2dbd6756 /src/xine-engine/audio_out.c | |
parent | eafb4f823a16426e7b2b30ada1b3cca47d8eeb3c (diff) | |
download | xine-lib-5f31761a4fa6995592cdd536c52f6ddac8151a89.tar.gz xine-lib-5f31761a4fa6995592cdd536c52f6ddac8151a89.tar.bz2 |
- add buf->decoder_info_ptr: portability for systems where pointer has
different sizeof than integer.
- add extra_info structure to pass informations from input/demuxers down
to the output frame. this can be used, for example, to pass the frame
number of a frame (when known by decoder). also, immediate benefict is
that we now have a slider which really shows the current position of
the playing stream. new fields can be added to extra_info keeping
binary compatibility
- bumpy everybody's api versions
CVS patchset: 3603
CVS date: 2002/12/21 12:56:44
Diffstat (limited to 'src/xine-engine/audio_out.c')
-rw-r--r-- | src/xine-engine/audio_out.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 8693a9678..b057cf1dc 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -17,7 +17,7 @@ * along with self program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.c,v 1.89 2002/12/14 16:33:59 jkeil Exp $ + * $Id: audio_out.c,v 1.90 2002/12/21 12:56:51 miguelfreitas Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe <andy@alsaplayer.org> @@ -573,6 +573,11 @@ static void *ao_loop (void *this_gen) { } pthread_mutex_unlock( &this->driver_lock ); + + if( in_buf && in_buf->stream && !in_buf->stream->video_decoder_plugin ) { + extra_info_merge( in_buf->stream->current_extra_info, in_buf->extra_info ); + } + /* * where, in the timeline is the "end" of the * hardware audio buffer at the moment? @@ -827,7 +832,12 @@ static int ao_open(xine_audio_port_t *this, xine_stream_t *stream, } static audio_buffer_t *ao_get_buffer (xine_audio_port_t *this) { - return fifo_remove (this->free_fifo); + audio_buffer_t *buf; + + buf = fifo_remove (this->free_fifo); + extra_info_reset( buf->extra_info ); + + return buf; } static void ao_put_buffer (xine_audio_port_t *this, audio_buffer_t *buf, xine_stream_t *stream) { @@ -839,6 +849,9 @@ static void ao_put_buffer (xine_audio_port_t *this, audio_buffer_t *buf, xine_st return; } + buf->stream = stream; + extra_info_merge( buf->extra_info, stream->audio_decoder_extra_info ); + pts = buf->vpts; buf->vpts = stream->metronom->got_audio_samples (stream->metronom, pts, @@ -926,8 +939,10 @@ static void ao_exit(xine_audio_port_t *this) { xine_list_free(this->streams); free (this->frame_buf[0]->mem); + free (this->frame_buf[0]->extra_info); free (this->frame_buf[0]); free (this->frame_buf[1]->mem); + free (this->frame_buf[1]->extra_info); free (this->frame_buf[1]); free (this->zero_space); @@ -938,6 +953,7 @@ static void ao_exit(xine_audio_port_t *this) { next = buf->next; free (buf->mem); + free (buf->extra_info); free (buf); buf = next; @@ -950,6 +966,7 @@ static void ao_exit(xine_audio_port_t *this) { next = buf->next; free (buf->mem); + free (buf->extra_info); free (buf); buf = next; @@ -1117,7 +1134,8 @@ xine_audio_port_t *ao_new_port (xine_t *xine, ao_driver_t *driver) { buf = (audio_buffer_t *) xine_xmalloc (sizeof (audio_buffer_t)); buf->mem = xine_xmalloc (AUDIO_BUF_SIZE); buf->mem_size = AUDIO_BUF_SIZE; - + buf->extra_info = malloc(sizeof(extra_info_t)); + fifo_append (this->free_fifo, buf); } @@ -1129,6 +1147,7 @@ xine_audio_port_t *ao_new_port (xine_t *xine, ao_driver_t *driver) { buf = (audio_buffer_t *) xine_xmalloc (sizeof (audio_buffer_t)); buf->mem = xine_xmalloc (4*AUDIO_BUF_SIZE); buf->mem_size = 4*AUDIO_BUF_SIZE; + buf->extra_info = malloc(sizeof(extra_info_t)); this->frame_buf[i] = buf; } |