diff options
Diffstat (limited to 'src/input/input_file.c')
-rw-r--r-- | src/input/input_file.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/input/input_file.c b/src/input/input_file.c index 56da22106..ed61343df 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.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: input_file.c,v 1.74 2003/01/29 18:53:59 miguelfreitas Exp $ + * $Id: input_file.c,v 1.75 2003/03/03 07:37:23 esnel Exp $ */ #ifdef HAVE_CONFIG_H @@ -92,31 +92,17 @@ static off_t file_plugin_read (input_plugin_t *this_gen, char *buf, off_t len) { return read (this->fh, buf, len); } -/* - * helper function to release buffer - * in case demux thread is cancelled - */ -static void pool_release_buffer (void *arg) { - buf_element_t *buf = (buf_element_t *) arg; - if( buf != NULL ) - buf->free_buffer(buf); -} - static buf_element_t *file_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, off_t todo) { off_t num_bytes, total_bytes; file_input_plugin_t *this = (file_input_plugin_t *) this_gen; buf_element_t *buf = fifo->buffer_pool_alloc (fifo); - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,NULL); - pthread_cleanup_push( pool_release_buffer, buf ); - buf->content = buf->mem; buf->type = BUF_DEMUX_BLOCK; total_bytes = 0; while (total_bytes < todo) { - pthread_testcancel(); num_bytes = read (this->fh, buf->mem + total_bytes, todo-total_bytes); if (num_bytes <= 0) { if (num_bytes < 0) @@ -132,9 +118,6 @@ static buf_element_t *file_plugin_read_block (input_plugin_t *this_gen, fifo_buf if( buf != NULL ) buf->size = total_bytes; - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,NULL); - pthread_cleanup_pop(0); - return buf; } |