summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2009-08-25 09:47:18 +0000
committerphintuka <phintuka>2009-08-25 09:47:18 +0000
commitf575d43844e189c7f853423e7a5e5dbe7f133c8e (patch)
tree07f3b38bd1f0bc5af276a18f788ec2eadc48178a
parentcd2b2530eeee30b3ae7550f72474a4cc1241086b (diff)
downloadxineliboutput-f575d43844e189c7f853423e7a5e5dbe7f133c8e.tar.gz
xineliboutput-f575d43844e189c7f853423e7a5e5dbe7f133c8e.tar.bz2
Fixed local mode polling for HD streams
-rw-r--r--xine_input_vdr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xine_input_vdr.c b/xine_input_vdr.c
index 14ee5d96..e0b71cfc 100644
--- a/xine_input_vdr.c
+++ b/xine_input_vdr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_input_vdr.c,v 1.283 2009-08-25 09:43:58 phintuka Exp $
+ * $Id: xine_input_vdr.c,v 1.284 2009-08-25 09:47:18 phintuka Exp $
*
*/
@@ -83,6 +83,7 @@
#define METRONOM_PREBUFFER_VAL (4 * 90000 / 25 )
#define HD_BUF_NUM_BUFS (2500) /* 2k payload * 2500 = 5MB */
#define HD_BUF_ELEM_SIZE (2048+64)
+#define HD_BUF_RESERVED_BUFS 2
#define RADIO_MAX_BUFFERS 10
@@ -124,7 +125,7 @@
# include <linux/unistd.h> /* syscall(__NR_gettid) */
#endif
-static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.283 2009-08-25 09:43:58 phintuka Exp $";
+static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.284 2009-08-25 09:47:18 phintuka Exp $";
static const char log_module_input_vdr[] = "[input_vdr] ";
#define LOG_MODULENAME log_module_input_vdr
#define SysLogLevel iSysLogLevel
@@ -1278,7 +1279,7 @@ static buf_element_t *get_buf_element(vdr_input_plugin_t *this, int size, int fo
/* HD buffer */
if (this->hd_stream && size <= HD_BUF_ELEM_SIZE) {
- if (this->hd_buffer->buffer_pool_num_free > 2)
+ if (this->hd_buffer->buffer_pool_num_free > HD_BUF_RESERVED_BUFS)
buf = this->hd_buffer->buffer_pool_try_alloc(this->hd_buffer);
if (!force && !buf)
return NULL;
@@ -2513,8 +2514,9 @@ static const struct {
static int vdr_plugin_poll(vdr_input_plugin_t *this, int timeout_ms)
{
struct timespec abstime;
- fifo_buffer_t *fifo = this->buffer_pool;
- int reserved_bufs = fifo->buffer_pool_capacity - this->max_buffers;
+ fifo_buffer_t *fifo = this->hd_stream ? this->hd_buffer : this->buffer_pool;
+ int reserved_bufs = this->hd_stream ? HD_BUF_RESERVED_BUFS :
+ (fifo->buffer_pool_capacity - this->max_buffers);
int result = 0;
/* Caller must have locked this->vdr_entry_lock ! */