From 24b7943016185571c079ea4a0e52588074540eeb Mon Sep 17 00:00:00 2001 From: Siggi Langauf Date: Thu, 20 Jun 2002 00:21:51 +0000 Subject: an attempt do be more defensive when trying to play AVI via http. Still segfaults playing http://gewurtz.mit.edu/videos/Aggressive.avi, though CVS patchset: 2101 CVS date: 2002/06/20 00:21:51 --- src/demuxers/demux_avi.c | 8 +++++++- src/input/input_http.c | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 9cca600b1..d87037aa7 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.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: demux_avi.c,v 1.95 2002/06/12 12:22:32 f1rmb Exp $ + * $Id: demux_avi.c,v 1.96 2002/06/20 00:21:52 siggi Exp $ * * demultiplexer for avi streams * @@ -1449,6 +1449,12 @@ static int demux_avi_open(demux_plugin_t *this_gen, input_plugin_t *input, int stage) { demux_avi_t *this = (demux_avi_t *) this_gen; + printf ("demux_avi: input capabilities = %d\n", + input->get_capabilities(input)); + if (! (input->get_capabilities(input) & INPUT_CAP_SEEKABLE)) { + printf("demux_avi.c: not seekable, can't handle!\n"); + return DEMUX_CANNOT_HANDLE; + } switch(stage) { diff --git a/src/input/input_http.c b/src/input/input_http.c index 996c2bd9b..ec60a0ff8 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -607,6 +607,14 @@ static off_t http_plugin_get_current_pos (input_plugin_t *this_gen){ return this->curpos; } +static off_t http_plugin_seek(input_plugin_t *this_gen, + off_t offset, int origin) { + + http_input_plugin_t *this = (http_input_plugin_t *) this_gen; + /* dummy implementation: don't seek, just return current position */ + return this->curpos; +} + static int http_plugin_eject_media (input_plugin_t *this_gen) { return 1; } @@ -687,7 +695,7 @@ input_plugin_t *init_input_plugin (int iface, xine_t *xine) { this->input_plugin.open = http_plugin_open; this->input_plugin.read = http_plugin_read; this->input_plugin.read_block = http_plugin_read_block; - this->input_plugin.seek = NULL; + this->input_plugin.seek = http_plugin_seek; this->input_plugin.get_current_pos = http_plugin_get_current_pos; this->input_plugin.get_length = http_plugin_get_length; this->input_plugin.get_blocksize = http_plugin_get_blocksize; -- cgit v1.2.3