diff options
author | Stefan Holst <holstsn@users.sourceforge.net> | 2002-12-12 22:08:09 +0000 |
---|---|---|
committer | Stefan Holst <holstsn@users.sourceforge.net> | 2002-12-12 22:08:09 +0000 |
commit | 41760a052b481e67ba31af505352860be86b94bf (patch) | |
tree | 1cd421c33a9c976d0e932c286c0ae4cd59a27b63 /src/input/input_pnm.c | |
parent | 0edd77bcd29eaadd898ba789ac6b594c13cd6eb4 (diff) | |
download | xine-lib-41760a052b481e67ba31af505352860be86b94bf.tar.gz xine-lib-41760a052b481e67ba31af505352860be86b94bf.tar.bz2 |
* Initial version of an rtsp input plugin. It is far from being perfect,
only a few streams work for now.
* A couple of fixes in pnm input plugin.
* Fixed stream info in demux_real.
CVS patchset: 3495
CVS date: 2002/12/12 22:08:09
Diffstat (limited to 'src/input/input_pnm.c')
-rw-r--r-- | src/input/input_pnm.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/input/input_pnm.c b/src/input/input_pnm.c index e30d0e721..35f4ea2d1 100644 --- a/src/input/input_pnm.c +++ b/src/input/input_pnm.c @@ -43,9 +43,11 @@ #include "pnm.h" #include "net_buf_ctrl.h" - +/* #define LOG +*/ +#define BUFSIZE 1025 extern int errno; @@ -71,7 +73,7 @@ typedef struct { nbc_t *nbc; - char scratch[1025]; + char scratch[BUFSIZE]; } pnm_input_plugin_t; @@ -121,11 +123,23 @@ static buf_element_t *pnm_plugin_read_block (input_plugin_t *this_gen, } static off_t pnm_plugin_seek (input_plugin_t *this_gen, off_t offset, int origin) { - /* pnm_input_plugin_t *this = (pnm_input_plugin_t *) this_gen; - */ - return -1; + printf ("input_pnm: seek %lld bytes, origin %d\n", + offset, origin); + + /* only realtive forward-seeking is implemented */ + + if ((origin == SEEK_CUR) && (offset >= 0)) { + + for (;((int)offset) - BUFSIZE > 0; offset -= BUFSIZE) { + this->curpos += pnm_plugin_read (this_gen, this->scratch, BUFSIZE); + } + + this->curpos += pnm_plugin_read (this_gen, this->scratch, offset); + } + + return this->curpos; } static off_t pnm_plugin_get_length (input_plugin_t *this_gen) { |