summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-09-05 17:49:20 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-09-05 17:49:20 +0000
commita3197976e6b3c1e191cec59780d947aec64a0076 (patch)
tree3d4a05c3fbcb35a667dac7c3a03b1dae727c1042 /src
parent792cd6f291ddbc5da430d2273c7d9d5fcb1a8681 (diff)
downloadxine-lib-a3197976e6b3c1e191cec59780d947aec64a0076.tar.gz
xine-lib-a3197976e6b3c1e191cec59780d947aec64a0076.tar.bz2
generate index only once per mrl
CVS patchset: 569 CVS date: 2001/09/05 17:49:20
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_avi.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index bc2066b6e..dc2e76884 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.35 2001/09/05 17:08:18 guenter Exp $
+ * $Id: demux_avi.c,v 1.36 2001/09/05 17:49:20 guenter Exp $
*
* demultiplexer for avi streams
*
@@ -125,6 +125,8 @@ typedef struct demux_avi_s {
uint32_t AVI_errno;
int send_end_buffers;
+
+ char last_mrl[1024];
} demux_avi_t ;
#define AVI_ERR_SIZELIM 1 /* The write of the data would exceed
@@ -821,8 +823,10 @@ static void demux_avi_stop (demux_plugin_t *this_gen) {
pthread_cancel (this->thread);
pthread_join (this->thread, &p);
+ /*
AVI_close (this->avi);
this->avi = NULL;
+ */
this->video_fifo->clear(this->video_fifo);
if (this->audio_fifo)
@@ -1069,12 +1073,18 @@ static int demux_avi_open(demux_plugin_t *this_gen,
this->input = input;
- this->avi = AVI_init (this);
+ if (strncmp(this->last_mrl, input->get_mrl (input), 1024)) {
+ if (this->avi)
+ AVI_close (this->avi);
+ this->avi = AVI_init (this);
+ }
if (this->avi) {
printf ("demux_avi: %ld frames\n", this->avi->video_frames);
+ strncpy(this->last_mrl, input->get_mrl (input), 1024);
+
return DEMUX_CAN_HANDLE;
} else
printf ("demux_avi: AVI_init failed (AVI_errno: %d)\n",this->AVI_errno);
@@ -1095,10 +1105,17 @@ static int demux_avi_open(demux_plugin_t *this_gen,
if(ending) {
if(!strcasecmp(ending, ".avi")) {
this->input = input;
- this->avi = AVI_init (this);
- if (this->avi)
+
+ if (strncmp(this->last_mrl, input->get_mrl (input), 1024)) {
+ if (this->avi)
+ AVI_close (this->avi);
+ this->avi = AVI_init (this);
+ }
+
+ if (this->avi) {
+ strncpy(this->last_mrl, input->get_mrl (input), 1024);
return DEMUX_CAN_HANDLE;
- else {
+ } else {
printf ("demux_avi: AVI_init failed (AVI_errno: %d)\n",this->AVI_errno);
return DEMUX_CANNOT_HANDLE;
}