diff options
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/Makefile.am | 24 | ||||
-rw-r--r-- | src/xine-engine/buffer.c | 20 | ||||
-rw-r--r-- | src/xine-engine/buffer.h | 4 |
3 files changed, 36 insertions, 12 deletions
diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am index e2ff961ee..732eb4011 100644 --- a/src/xine-engine/Makefile.am +++ b/src/xine-engine/Makefile.am @@ -8,21 +8,24 @@ AM_CFLAGS = $(THREAD_CFLAGS) $(X_CFLAGS) @ANSI_FLAGS@ lib_LTLIBRARIES = libxine.la -XINEUTILS_LIB = $(top_builddir)/src/xine-utils/libxineutils.la - -if HAVE_NVTV -NVTVCLIENT_LIB = nvtv/libnvclient.la -endif +XINEUTILS_LIB = $(top_builddir)/src/xine-utils/libxineutils.la +NVTVCLIENT_LIB = $(top_builddir)/src/xine-engine/nvtv/libnvclient.la libxine_la_SOURCES = xine.c metronom.c configfile.c buffer.c \ load_plugins.c video_decoder.c buffer_types.c \ audio_decoder.c video_out.c audio_out.c resample.c events.c lrb.c \ video_overlay.c osd.c scratch.c locale.c demux.c vo_scale.c \ xine_interface.c post.c tvmode.c -libxine_la_DEPENDENCIES = @INTLLIBS@ $(XINEUTILS_LIB) $(NVTVCLIENT_LIB) -libxine_la_LIBADD = $(THREAD_LIBS) $(DYNAMIC_LD_LIBS) @INTLLIBS@ $(ZLIB_LIBS)\ - -lm $(XINEUTILS_LIB) $(NVTVCLIENT_LIB) +if HAVE_NVTV +libxine_la_DEPENDENCIES = @INTLLIBS@ $(XINEUTILS_LIB) $(NVTVCLIENT_LIB) +libxine_la_LIBADD = $(THREAD_LIBS) $(DYNAMIC_LD_LIBS) @INTLLIBS@ $(ZLIB_LIBS) \ + -lm $(XINEUTILS_LIB) $(NVTVCLIENT_LIB) +else +libxine_la_DEPENDENCIES = @INTLLIBS@ $(XINEUTILS_LIB) +libxine_la_LIBADD = $(THREAD_LIBS) $(DYNAMIC_LD_LIBS) @INTLLIBS@ $(ZLIB_LIBS) \ + -lm $(XINEUTILS_LIB) +endif libxine_la_LDFLAGS = \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) @@ -45,7 +48,10 @@ install-debug: debug @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am $(XINEUTILS_LIB): - cd $(top_srcdir)/src/xine-utils; make + cd $(top_srcdir)/src/xine-utils && $(MAKE) libxineutils.la + +$(NVTVCLIENT_LIB): + cd $(top_builddir)/src/xine-engine/nvtv && $(MAKE) libnvclient.la ### # Install header files (default=$includedir/xine) diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c index 2e93009a1..e3db4a75c 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.20 2002/12/22 15:02:06 miguelfreitas Exp $ + * $Id: buffer.c,v 1.21 2003/01/26 23:31:13 f1rmb Exp $ * * * contents: @@ -163,9 +163,10 @@ static void fifo_buffer_put (fifo_buffer_t *fifo, buf_element_t *element) { else fifo->first = element; - fifo->last = element; + fifo->last = element; element->next = NULL; fifo->fifo_size++; + fifo->data_size += element->size; pthread_cond_signal (&fifo->not_empty); @@ -186,6 +187,7 @@ static void fifo_buffer_insert (fifo_buffer_t *fifo, buf_element_t *element) { fifo->last = element; fifo->fifo_size++; + fifo->data_size += element->size; pthread_cond_signal (&fifo->not_empty); @@ -213,6 +215,7 @@ static buf_element_t *fifo_buffer_get (fifo_buffer_t *fifo) { fifo->last = NULL; fifo->fifo_size--; + fifo->data_size -= buf->size; pthread_mutex_unlock (&fifo->mutex); @@ -273,6 +276,19 @@ static int fifo_buffer_size (fifo_buffer_t *this) { } /* + * Return the amount of the data in the fifo buffer + */ +static uint32_t fifo_buffer_data_size (fifo_buffer_t *this) { + int data_size; + + pthread_mutex_lock(&this->mutex); + data_size = this->data_size; + pthread_mutex_unlock(&this->mutex); + + return data_size; +} + +/* * Destroy the buffer */ static void fifo_buffer_dispose (fifo_buffer_t *this) { diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h index c79bcf139..0bfabb127 100644 --- a/src/xine-engine/buffer.h +++ b/src/xine-engine/buffer.h @@ -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.h,v 1.96 2003/01/19 21:29:55 guenter Exp $ + * $Id: buffer.h,v 1.97 2003/01/26 23:31:13 f1rmb Exp $ * * * contents: @@ -391,7 +391,9 @@ typedef struct fifo_buffer_s fifo_buffer_t; struct fifo_buffer_s { buf_element_t *first, *last; + int fifo_size; + uint32_t data_size; pthread_mutex_t mutex; pthread_cond_t not_empty; |