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/buffer.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/buffer.c')
-rw-r--r-- | src/xine-engine/buffer.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c index 4d1c50805..e4d1c7724 100644 --- a/src/xine-engine/buffer.c +++ b/src/xine-engine/buffer.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: buffer.c,v 1.18 2002/07/17 18:36:44 miguelfreitas Exp $ + * $Id: buffer.c,v 1.19 2002/12/21 12:56:52 miguelfreitas Exp $ * * * contents: @@ -39,6 +39,7 @@ #include <stdlib.h> #include "buffer.h" #include "xineutils.h" +#include "xine_internal.h" /* * put a previously allocated buffer element back into the buffer pool @@ -108,8 +109,8 @@ static buf_element_t *buffer_pool_alloc (fifo_buffer_t *this) { buf->content = buf->mem; /* 99% of demuxers will want this */ buf->pts = 0; buf->size = 0; - buf->input_pos = buf->input_length = buf->input_time = 0; buf->decoder_flags = 0; + extra_info_reset( buf->extra_info ); return buf; } @@ -196,18 +197,6 @@ static void fifo_buffer_clear (fifo_buffer_t *fifo) { buf = next; } - /* - while (fifo->first != NULL) { - - buf = fifo->first; - - fifo->first = fifo->first->next; - if (fifo->first==NULL) - fifo->last = NULL; - - buf->free_buffer(buf); - } - */ /*printf("Free buffers after clear: %d\n", fifo->buffer_pool_num_free);*/ pthread_mutex_unlock (&fifo->mutex); @@ -241,6 +230,7 @@ static void fifo_buffer_dispose (fifo_buffer_t *this) { next = buf->next; + free (buf->extra_info); free (buf); received++; @@ -251,6 +241,7 @@ static void fifo_buffer_dispose (fifo_buffer_t *this) { buf = this->get(this); + free(buf->extra_info); free(buf); received++; } @@ -311,13 +302,14 @@ fifo_buffer_t *fifo_buffer_new (int num_buffers, uint32_t buf_size) { buf_element_t *buf; buf = xine_xmalloc (sizeof (buf_element_t)); - + buf->mem = multi_buffer; multi_buffer += buf_size; buf->max_size = buf_size; buf->free_buffer = buffer_pool_free; buf->source = this; + buf->extra_info = malloc(sizeof(extra_info_t)); buffer_pool_free (buf); } |