summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2001-09-11 11:30:56 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2001-09-11 11:30:56 +0000
commit79aecdf09a68fd3a32ad6059b790ce26c0ae0c71 (patch)
tree6d3c2d1f34e2a945376c268482b9ee69dceca1a7
parentb7cd7617ab7ae0d1f53e9739e94afc529d9c46de (diff)
downloadxine-lib-79aecdf09a68fd3a32ad6059b790ce26c0ae0c71.tar.gz
xine-lib-79aecdf09a68fd3a32ad6059b790ce26c0ae0c71.tar.bz2
remove obsoleted stuff by the new cache scheme.
(cancellation point now into read_cache.c) CVS patchset: 612 CVS date: 2001/09/11 11:30:56
-rw-r--r--src/input/input_dvd.c22
-rw-r--r--src/input/read_cache.c13
2 files changed, 9 insertions, 26 deletions
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 239997f2e..37a9557dd 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -12,12 +12,12 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* 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_dvd.c,v 1.23 2001/09/11 00:57:11 guenter Exp $
+ * $Id: input_dvd.c,v 1.24 2001/09/11 11:30:56 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -240,16 +240,6 @@ static off_t dvd_plugin_read (input_plugin_t *this_gen,
return 0;
}
-/*
- * 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 *dvd_plugin_read_block (input_plugin_t *this_gen,
fifo_buffer_t *fifo, off_t nlen) {
@@ -268,19 +258,11 @@ static buf_element_t *dvd_plugin_read_block (input_plugin_t *this_gen,
}
if ((buf = read_cache_read_block (this->read_cache, this->file_lbcur*DVD_VIDEO_LB_LEN))) {
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,NULL);
- pthread_cleanup_push( pool_release_buffer, buf );
-
- pthread_testcancel();
- buf->type = BUF_DEMUX_BLOCK;
-
this->file_lbcur++;
this->file_size_left -= DVD_VIDEO_LB_LEN;
buf->type = BUF_DEMUX_BLOCK;
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,NULL);
- pthread_cleanup_pop(0);
} else {
printf ("input_dvd: read error in input_dvd plugin\n");
}
diff --git a/src/input/read_cache.c b/src/input/read_cache.c
index 406f8b44e..c8d52486c 100644
--- a/src/input/read_cache.c
+++ b/src/input/read_cache.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: read_cache.c,v 1.2 2001/09/11 09:58:15 jkeil Exp $
+ * $Id: read_cache.c,v 1.3 2001/09/11 11:30:56 miguelfreitas Exp $
*/
#include <sys/types.h>
@@ -202,9 +202,9 @@ buf_element_t *read_cache_read_block (read_cache_t *this,
while (this->mbuf_pool_top==NULL) {
pthread_cond_wait (&this->mbuf_pool_not_empty, &this->lock);
}
-
+
mbuf = this->mbuf_pool_top;
-
+
this->mbuf_pool_top = this->mbuf_pool_top->next;
}
@@ -213,6 +213,7 @@ buf_element_t *read_cache_read_block (read_cache_t *this,
/* FIXME: error checking */
lseek (this->fd, madr, SEEK_SET) ;
+ pthread_testcancel();
read ( this->fd, mbuf->data, 2048*16);
this->cur_mbuf = mbuf;
@@ -227,9 +228,9 @@ buf_element_t *read_cache_read_block (read_cache_t *this,
while (this->buf_pool_top==NULL) {
pthread_cond_wait (&this->buf_pool_not_empty, &this->lock);
}
-
+
buf = this->buf_pool_top;
-
+
this->buf_pool_top = this->buf_pool_top->next;
buf->mem = mbuf->data + badr;
@@ -238,7 +239,7 @@ buf_element_t *read_cache_read_block (read_cache_t *this,
mbuf->ref++;
- pthread_cleanup_pop (0);
+ pthread_cleanup_pop (0);
pthread_mutex_unlock (&this->lock);
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,NULL);