diff options
Diffstat (limited to 'src/demuxers')
-rw-r--r-- | src/demuxers/demux_avi.c | 76 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg.c | 60 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg_block.c | 40 |
3 files changed, 90 insertions, 86 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 3469467ad..4fdf68d2e 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.3 2001/04/21 00:14:40 f1rmb Exp $ + * $Id: demux_avi.c,v 1.4 2001/04/24 17:42:26 guenter Exp $ * * demultiplexer for avi streams * @@ -260,7 +260,7 @@ static avi_t *AVI_init(demux_avi_t *this) /* Read first 12 bytes and check that this is an AVI file */ - if( this->input->read(data,12) != 12 ) ERR_EXIT(AVI_ERR_READ) ; + if( this->input->read(this->input, data,12) != 12 ) ERR_EXIT(AVI_ERR_READ) ; if( strncasecmp(data ,"RIFF",4) !=0 || strncasecmp(data+8,"AVI ",4) !=0 ) ERR_EXIT(AVI_ERR_NO_AVI) ; @@ -271,29 +271,29 @@ static avi_t *AVI_init(demux_avi_t *this) hdrl_data = 0; while(1) { - if (this->input->read(data,8) != 8 ) break; /* We assume it's EOF */ + if (this->input->read(this->input, data,8) != 8 ) break; /* We assume it's EOF */ n = str2ulong(data+4); n = PAD_EVEN(n); if(strncasecmp(data,"LIST",4) == 0) { - if( this->input->read(data,4) != 4 ) ERR_EXIT(AVI_ERR_READ) + if( this->input->read(this->input, data,4) != 4 ) ERR_EXIT(AVI_ERR_READ) n -= 4; if(strncasecmp(data,"hdrl",4) == 0) { hdrl_len = n; hdrl_data = (unsigned char *) xmalloc(n); if(hdrl_data==0) ERR_EXIT(AVI_ERR_NO_MEM) - if( this->input->read(hdrl_data,n) != n ) ERR_EXIT(AVI_ERR_READ) + if( this->input->read(this->input, hdrl_data,n) != n ) ERR_EXIT(AVI_ERR_READ) } else if(strncasecmp(data,"movi",4) == 0) { - AVI->movi_start = this->input->seek(0,SEEK_CUR); - this->input->seek(n,SEEK_CUR); + AVI->movi_start = this->input->seek(this->input, 0,SEEK_CUR); + this->input->seek(this->input, n, SEEK_CUR); } else - this->input->seek(n,SEEK_CUR); + this->input->seek(this->input, n, SEEK_CUR); } else if(strncasecmp(data,"idx1",4) == 0) { @@ -303,10 +303,10 @@ static avi_t *AVI_init(demux_avi_t *this) AVI->n_idx = AVI->max_idx = n/16; AVI->idx = (unsigned char((*)[16]) ) xmalloc(n); if(AVI->idx==0) ERR_EXIT(AVI_ERR_NO_MEM) - if( this->input->read((char *)AVI->idx,n) != n ) ERR_EXIT(AVI_ERR_READ) + if( this->input->read(this->input, (char *)AVI->idx, n) != n ) ERR_EXIT(AVI_ERR_READ) } else - this->input->seek(n,SEEK_CUR); + this->input->seek(this->input, n, SEEK_CUR); } if(!hdrl_data) ERR_EXIT(AVI_ERR_NO_HDRL) ; @@ -411,7 +411,7 @@ static avi_t *AVI_init(demux_avi_t *this) AVI->audio_tag[2] = 'w'; AVI->audio_tag[3] = 'b'; - this->input->seek(AVI->movi_start,SEEK_SET); + this->input->seek(this->input, AVI->movi_start, SEEK_SET); /* if the file has an idx1, check if this is relative to the start of the file or to the start of the movi list */ @@ -432,16 +432,16 @@ static avi_t *AVI_init(demux_avi_t *this) pos = str2ulong(AVI->idx[i]+ 8); len = str2ulong(AVI->idx[i]+12); - this->input->seek(pos,SEEK_SET); - if(this->input->read(data,8)!=8) ERR_EXIT(AVI_ERR_READ) ; + this->input->seek(this->input, pos, SEEK_SET); + if(this->input->read(this->input, data, 8)!=8) ERR_EXIT(AVI_ERR_READ) ; if( strncasecmp(data,AVI->idx[i],4)==0 && str2ulong(data+4)==len ) { idx_type = 1; /* Index from start of file */ } else { - this->input->seek(pos+AVI->movi_start-4,SEEK_SET); - if(this->input->read(data,8)!=8) ERR_EXIT(AVI_ERR_READ) ; + this->input->seek(this->input, pos+AVI->movi_start-4, SEEK_SET); + if(this->input->read(this->input, data, 8)!=8) ERR_EXIT(AVI_ERR_READ) ; if( strncasecmp(data,AVI->idx[i],4)==0 && str2ulong(data+4)==len ) { idx_type = 2; /* Index from start of movi list */ @@ -454,20 +454,20 @@ static avi_t *AVI_init(demux_avi_t *this) { /* we must search through the file to get the index */ - this->input->seek( AVI->movi_start, SEEK_SET); + this->input->seek(this->input, AVI->movi_start, SEEK_SET); AVI->n_idx = 0; while(1) { - if( this->input->read(data,8) != 8 ) break; + if( this->input->read(this->input, data,8) != 8 ) break; n = str2ulong(data+4); /* The movi list may contain sub-lists, ignore them */ if(strncasecmp(data,"LIST",4)==0) { - this->input->seek(4,SEEK_CUR); + this->input->seek(this->input, 4,SEEK_CUR); continue; } @@ -478,10 +478,10 @@ static avi_t *AVI_init(demux_avi_t *this) || ( (data[2]=='w' || data[2]=='W') && (data[3]=='b' || data[3]=='B') ) ) { - avi_add_index_entry(AVI,data,0,this->input->seek(0,SEEK_CUR)-8,n); + avi_add_index_entry(AVI,data,0,this->input->seek(this->input, 0, SEEK_CUR)-8,n); } - this->input->seek(PAD_EVEN(n),SEEK_CUR); + this->input->seek(this->input, PAD_EVEN(n), SEEK_CUR); } idx_type = 1; } @@ -537,7 +537,7 @@ static avi_t *AVI_init(demux_avi_t *this) /* Reposition the file */ - this->input->seek(AVI->movi_start,SEEK_SET); + this->input->seek(this->input, AVI->movi_start, SEEK_SET); AVI->video_posf = 0; AVI->video_posb = 0; @@ -627,9 +627,9 @@ static long AVI_read_audio(demux_avi_t *this, avi_t *AVI, char *audbuf, todo = left; pos = AVI->audio_index[AVI->audio_posc].pos + AVI->audio_posb; /* printf ("demux_avi: read audio from %d\n", pos); */ - if (this->input->seek (pos, SEEK_SET)<0) + if (this->input->seek (this->input, pos, SEEK_SET)<0) return -1; - if (this->input->read(audbuf+nr,todo) != todo) + if (this->input->read(this->input, audbuf+nr,todo) != todo) { AVI->AVI_errno = AVI_ERR_READ; *bFrameDone = 0; @@ -674,9 +674,9 @@ static long AVI_read_video(demux_avi_t *this, avi_t *AVI, char *vidbuf, todo = left; pos = AVI->video_index[AVI->video_posf].pos + AVI->video_posb; /* printf ("demux_avi: read video from %d\n", pos); */ - if (this->input->seek (pos, SEEK_SET)<0) + if (this->input->seek (this->input, pos, SEEK_SET)<0) return -1; - if (this->input->read(vidbuf+nr,todo) != todo) + if (this->input->read(this->input, vidbuf+nr,todo) != todo) { AVI->AVI_errno = AVI_ERR_READ; *bFrameDone = 0; @@ -700,7 +700,7 @@ static int demux_avi_next (demux_avi_t *this) { if (this->avi->video_frames <= this->avi->video_posf) return 0; - buf = this->audio_fifo->buffer_pool_alloc (); + buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->content = buf->mem; buf->DTS = 0 ; /* FIXME */ @@ -714,7 +714,7 @@ static int demux_avi_next (demux_avi_t *this) { buf->size = AVI_read_audio (this, this->avi, buf->mem, 2048, &buf->frame_end); buf->PTS = 0; - buf->input_pos = this->input->seek (0, SEEK_CUR); + buf->input_pos = this->input->seek (this->input, 0, SEEK_CUR); switch (this->avi->a_fmt) { case 0x01: @@ -767,10 +767,10 @@ static void *demux_avi_loop (void *this_gen) { } while (this->status == DEMUX_OK) ; - buf = this->video_fifo->buffer_pool_alloc (); + buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->type = BUF_CONTROL_END; this->video_fifo->put (this->video_fifo, buf); - buf = this->audio_fifo->buffer_pool_alloc (); + buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_CONTROL_END; this->audio_fifo->put (this->audio_fifo, buf); @@ -861,15 +861,15 @@ static void demux_avi_start (demux_plugin_t *this_gen, * send start buffers */ - buf = this->video_fifo->buffer_pool_alloc (); + buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->type = BUF_CONTROL_START; this->video_fifo->put (this->video_fifo, buf); - buf = this->audio_fifo->buffer_pool_alloc (); + buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_CONTROL_START; this->audio_fifo->put (this->audio_fifo, buf); - buf = this->video_fifo->buffer_pool_alloc (); + buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->content = buf->mem; this->avi->bih.biSize = this->video_step; /* HACK */ memcpy (buf->content, &this->avi->bih, sizeof (this->avi->bih)); @@ -877,7 +877,7 @@ static void demux_avi_start (demux_plugin_t *this_gen, buf->type = BUF_VIDEO_AVI; this->video_fifo->put (this->video_fifo, buf); - buf = this->audio_fifo->buffer_pool_alloc (); + buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->content = buf->mem; memcpy (buf->content, &this->avi->wavex, sizeof (this->avi->wavex)); @@ -897,15 +897,15 @@ static int demux_avi_open(demux_plugin_t *this_gen, input_plugin_t *input, int s case STAGE_BY_CONTENT: { uint8_t buf[4096]; - if (input->get_blocksize()) + if (input->get_blocksize(input)) return DEMUX_CANNOT_HANDLE; - if (!(input->get_capabilities() & INPUT_CAP_SEEKABLE)) + if (!(input->get_capabilities(input) & INPUT_CAP_SEEKABLE)) return DEMUX_CANNOT_HANDLE; - input->seek(0, SEEK_SET); + input->seek(input, 0, SEEK_SET); - if(input->read(buf, 4)) { + if(input->read(input, buf, 4)) { if((buf[0] == 0x52) && (buf[1] == 0x49) @@ -929,7 +929,7 @@ static int demux_avi_open(demux_plugin_t *this_gen, input_plugin_t *input, int s case STAGE_BY_EXTENSION: { char *ending, *mrl; - mrl = this->input->get_mrl (); + mrl = this->input->get_mrl (this->input); ending = strrchr(mrl, '.'); xprintf(VERBOSE|DEMUX, "demux_avi_can_handle: ending %s of %s\n", diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index 5cc08817c..ecdd17ef0 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.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_mpeg.c,v 1.3 2001/04/21 00:14:40 f1rmb Exp $ + * $Id: demux_mpeg.c,v 1.4 2001/04/24 17:42:26 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes @@ -67,7 +67,7 @@ static uint32_t read_bytes (demux_mpeg_t *this, int n) { buf[4]=0; - i = this->input->read (buf, n); + i = this->input->read (this->input, buf, n); if (i != n) { this->status = DEMUX_FINISHED; @@ -137,7 +137,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int nID) { } /* read rest of header */ - i = this->input->read (this->dummy_space, header_len+4); + i = this->input->read (this->input, this->dummy_space, header_len+4); track = this->dummy_space[0] & 0x0F ; @@ -145,12 +145,12 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int nID) { /* contents */ - buf = this->input->read_block (this->audio_fifo, nLen-4); + buf = this->input->read_block (this->input, this->audio_fifo, nLen-4); buf->type = BUF_AUDIO_AC3 + track; buf->PTS = pts; buf->DTS = 0 ; /* FIXME */ - buf->input_pos = this->input->get_current_pos (); + buf->input_pos = this->input->get_current_pos (this->input); this->audio_fifo->put (this->audio_fifo, buf); @@ -182,14 +182,14 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int nID) { } /* read rest of header */ - i = this->input->read (this->dummy_space, header_len); + i = this->input->read (this->input, this->dummy_space, header_len); - buf = this->input->read_block (this->audio_fifo, nLen); + buf = this->input->read_block (this->input, this->audio_fifo, nLen); buf->type = BUF_AUDIO_MPEG + track; buf->PTS = pts; buf->DTS = 0; /* FIXME */ - buf->input_pos = this->input->seek (0, SEEK_CUR); + buf->input_pos = this->input->seek (this->input, 0, SEEK_CUR); this->audio_fifo->put (this->audio_fifo, buf); @@ -220,11 +220,11 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int nID) { } /* read rest of header */ - i = this->input->read (this->dummy_space, header_len); + i = this->input->read (this->input, this->dummy_space, header_len); /* contents */ - buf = this->input->read_block (this->audio_fifo, nLen); + buf = this->input->read_block (this->input, this->audio_fifo, nLen); buf->type = BUF_VIDEO_MPEG; buf->PTS = pts; @@ -235,7 +235,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int nID) { } else { xprintf (VERBOSE|DEMUX, ",unknown stream - skipped"); - i = this->input->read (this->dummy_space, nLen); + i = this->input->read (this->input, this->dummy_space, nLen); /* (*this->input->seek) (nLen,SEEK_CUR); */ } @@ -332,12 +332,12 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int nID) xprintf (VERBOSE|DEMUX|AUDIO, ", audio #%d", track); - buf = this->input->read_block (this->audio_fifo, nLen); + buf = this->input->read_block (this->input, this->audio_fifo, nLen); buf->type = BUF_AUDIO_MPEG + track ; buf->PTS = pts; buf->DTS = 0; /* FIXME */ - buf->input_pos = this->input->seek (0, SEEK_CUR); + buf->input_pos = this->input->seek (this->input, 0, SEEK_CUR); this->audio_fifo->put (this->audio_fifo, buf); @@ -345,7 +345,7 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int nID) xprintf (VERBOSE|DEMUX|VIDEO, ", video #%d", nID & 0x0f); - buf = this->input->read_block (this->video_fifo, nLen); + buf = this->input->read_block (this->input, this->video_fifo, nLen); buf->type = BUF_VIDEO_MPEG; buf->PTS = pts; @@ -355,10 +355,10 @@ static void parse_mpeg1_packet (demux_mpeg_t *this, int nID) } else if (nID == 0xbd) { xprintf (VERBOSE|DEMUX|AC3, ", ac3"); - i = this->input->read (this->dummy_space, nLen); + i = this->input->read (this->input, this->dummy_space, nLen); } else { xprintf (VERBOSE|DEMUX, ", unknown (nID = %d)",nID); - this->input->read (this->dummy_space, nLen); + this->input->read (this->input, this->dummy_space, nLen); } xprintf (VERBOSE|DEMUX, ")\n"); @@ -404,7 +404,7 @@ static uint32_t parse_pack(demux_mpeg_t *this) buf = read_bytes (this, 2); xprintf (VERBOSE|DEMUX, " system_header (%d +6 bytes)\n",buf); - this->input->read (scratch,buf); + this->input->read (this->input, scratch, buf); buf = read_bytes (this, 4) ; } @@ -454,10 +454,10 @@ static void *demux_mpeg_loop (void *this_gen) { } while (this->status == DEMUX_OK) ; - buf = this->video_fifo->buffer_pool_alloc (); + buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->type = BUF_CONTROL_END; this->video_fifo->put (this->video_fifo, buf); - buf = this->audio_fifo->buffer_pool_alloc (); + buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_CONTROL_END; this->audio_fifo->put (this->audio_fifo, buf); @@ -495,15 +495,15 @@ static void demux_mpeg_start (demux_plugin_t *this_gen, this->status = DEMUX_OK; - if ((this->input->get_capabilities () & INPUT_CAP_SEEKABLE) != 0 ) { + if ((this->input->get_capabilities (this->input) & INPUT_CAP_SEEKABLE) != 0 ) { xprintf (VERBOSE|DEMUX, "=>seek to %Ld\n",pos); - this->input->seek (pos+4, SEEK_SET); + this->input->seek (this->input, pos+4, SEEK_SET); } - buf = this->video_fifo->buffer_pool_alloc (); + buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->type = BUF_CONTROL_START; this->video_fifo->put (this->video_fifo, buf); - buf = this->audio_fifo->buffer_pool_alloc (); + buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_CONTROL_START; this->audio_fifo->put (this->audio_fifo, buf); @@ -521,13 +521,13 @@ static int demux_mpeg_open(demux_plugin_t *this_gen, input_plugin_t *ip, int sta case STAGE_BY_CONTENT: { uint8_t buf[4096]; - if((ip->get_capabilities() & INPUT_CAP_SEEKABLE) != 0) { - ip->seek(0, SEEK_SET); + if((ip->get_capabilities(ip) & INPUT_CAP_SEEKABLE) != 0) { + ip->seek(ip, 0, SEEK_SET); - if(ip->get_blocksize()) + if(ip->get_blocksize(ip)) return DEMUX_CANNOT_HANDLE; - if(ip->read(buf, 6)) { + if(ip->read(ip, buf, 6)) { if(buf[0] || buf[1] || (buf[2] != 0x01)) return DEMUX_CANNOT_HANDLE; @@ -554,7 +554,7 @@ static int demux_mpeg_open(demux_plugin_t *this_gen, input_plugin_t *ip, int sta case STAGE_BY_EXTENSION: { char *media; char *ending; - char *MRL = ip->get_mrl(); + char *MRL = ip->get_mrl(ip); media = strstr(MRL, "://"); if(media) { @@ -612,10 +612,12 @@ demux_plugin_t *init_demux_plugin(int iface, config_values_t *config) { demux_mpeg_t *this = xmalloc (sizeof (demux_mpeg_t)); + xine_debug = config->lookup_int (config, "xine_debug", 0); + switch (iface) { case 1: - // FIXME xine_debug = xd; + this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->demux_plugin.open = demux_mpeg_open; this->demux_plugin.start = demux_mpeg_start; diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index bcdd003f6..1ee29506f 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.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_mpeg_block.c,v 1.3 2001/04/21 00:14:40 f1rmb Exp $ + * $Id: demux_mpeg_block.c,v 1.4 2001/04/24 17:42:26 guenter Exp $ * * demultiplexer for mpeg 1/2 program streams * @@ -69,7 +69,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this) { uint32_t nStreamID; - buf = this->input->read_block (this->video_fifo, this->blocksize); + buf = this->input->read_block (this->input, this->video_fifo, this->blocksize); if (buf==NULL) { this->status = DEMUX_FINISHED; @@ -223,7 +223,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this) { buf->type = BUF_SPU_PACKAGE + nSPUID; buf->PTS = nPTS; buf->DTS = nDTS ; - buf->input_pos = this->input->seek (0, SEEK_CUR); + buf->input_pos = this->input->seek (this->input, 0, SEEK_CUR); this->spu_fifo->put (this->spu_fifo, buf); @@ -240,7 +240,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this) { buf->type = BUF_AUDIO_AC3 + nTrack; buf->PTS = nPTS; buf->DTS = nDTS ; - buf->input_pos = this->input->seek (0, SEEK_CUR); + buf->input_pos = this->input->seek (this->input, 0, SEEK_CUR); this->audio_fifo->put (this->audio_fifo, buf); @@ -263,7 +263,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this) { buf->type = BUF_AUDIO_LPCM + nTrack; buf->PTS = nPTS; buf->DTS = nDTS ; - buf->input_pos = this->input->seek (0, SEEK_CUR); + buf->input_pos = this->input->seek (this->input, 0, SEEK_CUR); this->audio_fifo->put (this->audio_fifo, buf); @@ -279,7 +279,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this) { buf->type = BUF_VIDEO_MPEG; buf->PTS = nPTS; buf->DTS = nDTS; - buf->input_pos = this->input->seek (0, SEEK_CUR); + buf->input_pos = this->input->seek (this->input, 0, SEEK_CUR); this->video_fifo->put (this->video_fifo, buf); @@ -297,7 +297,7 @@ static void demux_mpeg_block_parse_pack (demux_mpeg_block_t *this) { buf->type = BUF_AUDIO_MPEG + nTrack; buf->PTS = nPTS; buf->DTS = nDTS; - buf->input_pos = this->input->seek (0, SEEK_CUR); + buf->input_pos = this->input->seek (this->input, 0, SEEK_CUR); this->audio_fifo->put (this->audio_fifo, buf); @@ -329,11 +329,11 @@ static void *demux_mpeg_block_loop (void *this_gen) { this->status = DEMUX_FINISHED; - buf = this->video_fifo->buffer_pool_alloc (); + buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->type = BUF_CONTROL_END; this->video_fifo->put (this->video_fifo, buf); - buf = this->audio_fifo->buffer_pool_alloc (); + buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo); buf->type = BUF_CONTROL_END; this->audio_fifo->put (this->audio_fifo, buf); @@ -375,19 +375,19 @@ static void demux_mpeg_block_start (demux_plugin_t *this_gen, pos /= (off_t) this->blocksize; pos *= (off_t) this->blocksize; - if((this->input->get_capabilities() & INPUT_CAP_SEEKABLE) != 0) { + if((this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) != 0) { xprintf (VERBOSE|DEMUX, "=>seek to %Ld\n",pos); - this->input->seek (pos, SEEK_SET); + this->input->seek (this->input, pos, SEEK_SET); } /* * send start buffer */ - buf = this->video_fifo->buffer_pool_alloc (); + buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); buf->type = BUF_CONTROL_START; this->video_fifo->put (this->video_fifo, buf); - buf = this->audio_fifo->buffer_pool_alloc (); + buf = this->audio_fifo->buffer_pool_alloc (this->video_fifo); buf->type = BUF_CONTROL_START; this->audio_fifo->put (this->audio_fifo, buf); @@ -410,15 +410,15 @@ static int demux_mpeg_block_open(demux_plugin_t *this_gen, case STAGE_BY_CONTENT: { uint8_t buf[4096]; - if((input->get_capabilities() & INPUT_CAP_SEEKABLE) != 0) { - input->seek(0, SEEK_SET); + if((input->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0) { + input->seek(input, 0, SEEK_SET); - this->blocksize = input->get_blocksize(); + this->blocksize = input->get_blocksize(input); if (!this->blocksize) return DEMUX_CANNOT_HANDLE; - if (input->read(buf, this->blocksize)) { + if (input->read(input, buf, this->blocksize)) { if(buf[0] || buf[1] || (buf[2] != 0x01)) return DEMUX_CANNOT_HANDLE; @@ -449,7 +449,7 @@ static int demux_mpeg_block_open(demux_plugin_t *this_gen, char *ending; char *MRL; - MRL = input->get_mrl (); + MRL = input->get_mrl (input); media = strstr(MRL, "://"); if(media) { @@ -506,10 +506,12 @@ demux_plugin_t *init_demux_mpeg_block(int iface, config_values_t *config) { demux_mpeg_block_t *this = xmalloc (sizeof (demux_mpeg_block_t)); + xine_debug = config->lookup_int (config, "xine_debug", 0); + switch (iface) { case 1: - // FIXME xine_debug = xd; + this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION; this->demux_plugin.open = demux_mpeg_block_open; this->demux_plugin.start = demux_mpeg_block_start; |