summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2009-11-09 12:46:02 +0000
committerphintuka <phintuka>2009-11-09 12:46:02 +0000
commit6f34cb0c8c042e5bd3af28651893690794339096 (patch)
tree760028590051a213473de51a880a0c128816da23
parent6c91b13206c51e2ca6efe6f8d3684b2f4a4990be (diff)
downloadxineliboutput-6f34cb0c8c042e5bd3af28651893690794339096.tar.gz
xineliboutput-6f34cb0c8c042e5bd3af28651893690794339096.tar.bz2
Implemented xine input plugin block mode.
Note: this causes segfault in xine-lib mpeg_block demuxer when trying to auto-detect demuxer.
-rw-r--r--xine/BluRay/input_bluray.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/xine/BluRay/input_bluray.c b/xine/BluRay/input_bluray.c
index 8d69067c..6f64b0b6 100644
--- a/xine/BluRay/input_bluray.c
+++ b/xine/BluRay/input_bluray.c
@@ -102,10 +102,10 @@ typedef struct {
static uint32_t bluray_plugin_get_capabilities (input_plugin_t *this_gen)
{
- return INPUT_CAP_SEEKABLE |
+ return INPUT_CAP_SEEKABLE |
+ INPUT_CAP_BLOCK |
INPUT_CAP_AUDIOLANG |
- INPUT_CAP_SPULANG |
- 0/*INPUT_CAP_BLOCK*/;
+ INPUT_CAP_SPULANG;
}
static off_t bluray_plugin_read (input_plugin_t *this_gen, char *buf, off_t len)
@@ -162,26 +162,23 @@ static buf_element_t *bluray_plugin_read_block (input_plugin_t *this_gen, fifo_b
{
buf_element_t *buf = fifo->buffer_pool_alloc (fifo);
- if (todo < 0) {
- buf->free_buffer (buf);
- return NULL;
- }
-
if (todo > (off_t)buf->max_size)
todo = buf->max_size;
if (todo > ALIGNED_UNIT_SIZE)
todo = ALIGNED_UNIT_SIZE;
- buf->type = BUF_DEMUX_BLOCK;
- buf->size = bluray_plugin_read(this_gen, (char*)buf->content, todo);
+ if (todo > 0) {
- if (buf->size <= 0) {
- buf->free_buffer (buf);
- return NULL;
+ buf->size = bluray_plugin_read(this_gen, (char*)buf->mem, todo);
+ buf->type = BUF_DEMUX_BLOCK;
+
+ if (buf->size > 0)
+ return buf;
}
- return buf;
+ buf->free_buffer (buf);
+ return NULL;
}
static off_t bluray_plugin_seek (input_plugin_t *this_gen, off_t offset, int origin)