Commit 6a4be21c authored by Stan Seibert's avatar Stan Seibert

Display prebuffer fill percentage. Extra thread cancellation test.

svn path=/trunk/vorbis-tools/; revision=2865
parent 4e52aaa3
......@@ -11,7 +11,7 @@
* *
********************************************************************
last mod: $Id: buffer.c,v 1.12 2001/12/19 05:37:32 volsung Exp $
last mod: $Id: buffer.c,v 1.13 2001/12/20 00:24:53 volsung Exp $
********************************************************************/
......@@ -758,6 +758,7 @@ buffer_stats_t *buffer_statistics (buf_t *buf)
stats->size = buf->size;
stats->fill = (double) buf->curfill / (double) buf->size * 100.0;
stats->prebuffer_fill = (double) buf->prebuffer_size / (double) buf->size;
stats->prebuffering = buf->prebuffering;
stats->paused = buf->paused;
stats->eos = buf->eos;
......@@ -768,5 +769,3 @@ buffer_stats_t *buffer_statistics (buf_t *buf)
return stats;
}
......@@ -11,7 +11,7 @@
* *
********************************************************************
last mod: $Id: buffer.h,v 1.4 2001/12/19 02:52:53 volsung Exp $
last mod: $Id: buffer.h,v 1.5 2001/12/20 00:24:54 volsung Exp $
********************************************************************/
......@@ -85,6 +85,7 @@ typedef struct action_t {
typedef struct buffer_stats_t {
long size;
double fill;
double prebuffer_fill;
int prebuffering;
int paused;
int eos;
......
......@@ -11,7 +11,7 @@
* *
********************************************************************
last mod: $Id: http_transport.c,v 1.6 2001/12/20 00:10:14 jack Exp $
last mod: $Id: http_transport.c,v 1.7 2001/12/20 00:24:54 volsung Exp $
********************************************************************/
......@@ -62,6 +62,8 @@ size_t write_callback (void *ptr, size_t size, size_t nmemb, void *arg)
buffer_submit_data(buf, ptr, size*nmemb);
pthread_testcancel();
return size * nmemb;
}
......
......@@ -11,7 +11,7 @@
* *
********************************************************************
last mod: $Id: status.c,v 1.3 2001/12/19 04:59:17 volsung Exp $
last mod: $Id: status.c,v 1.4 2001/12/20 00:24:54 volsung Exp $
********************************************************************/
......@@ -43,7 +43,8 @@ void write_buffer_state_string (char *dest, buffer_stats_t *buf_stats)
char *sep = "(";
if (buf_stats->prebuffering) {
cur += sprintf (cur, "%sPrebuf", sep);
cur += sprintf (cur, "%sPrebuf to %1.f%%", sep,
100.0f * buf_stats->prebuffer_fill);
sep = comma;
}
if (buf_stats->paused) {
......
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