summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_avi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_avi.c')
-rw-r--r--src/demuxers/demux_avi.c58
1 files changed, 38 insertions, 20 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index 20d498857..0013fef61 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.53 2001/11/18 03:53:23 guenter Exp $
+ * $Id: demux_avi.c,v 1.54 2001/11/30 00:53:51 f1rmb Exp $
*
* demultiplexer for avi streams
*
@@ -46,6 +46,8 @@
#include "libw32dll/wine/windef.h"
#include "libw32dll/wine/vfw.h"
+#define VALID_ENDS "avi"
+
/* The following variable indicates the kind of error */
typedef struct
@@ -107,6 +109,8 @@ typedef struct
typedef struct demux_avi_s {
demux_plugin_t demux_plugin;
+ config_values_t *config;
+
fifo_buffer_t *audio_fifo;
fifo_buffer_t *video_fifo;
@@ -1036,31 +1040,41 @@ static int demux_avi_open(demux_plugin_t *this_gen,
case STAGE_BY_EXTENSION: {
char *ending, *mrl;
+ char *m, *valid_ends;
mrl = input->get_mrl (input);
ending = strrchr(mrl, '.');
if(ending) {
- if(!strcasecmp(ending, ".avi")) {
- this->input = input;
-
- 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 {
- printf ("demux_avi: AVI_init failed (AVI_errno: %d)\n",this->AVI_errno);
- return DEMUX_CANNOT_HANDLE;
+ xine_strdupa(valid_ends, (this->config->register_string(this->config,
+ "mrl.ends_avi", VALID_ENDS,
+ "valid mrls ending for avi demuxer",
+ NULL, NULL, NULL)));
+ while((m = xine_strsep(&valid_ends, ",")) != NULL) {
+
+ while(*m == ' ' || *m == '\t') m++;
+
+ if(!strcasecmp((ending + 1), m)) {
+
+ this->input = input;
+
+ 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 {
+ printf ("demux_avi: AVI_init failed (AVI_errno: %d)\n",this->AVI_errno);
+ return DEMUX_CANNOT_HANDLE;
+ }
}
}
}
-
return DEMUX_CANNOT_HANDLE;
}
break;
@@ -1096,7 +1110,6 @@ static int demux_avi_get_stream_length (demux_plugin_t *this_gen) {
demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) {
demux_avi_t *this;
- config_values_t *config;
if (iface != 6) {
printf( "demux_avi: this plugin doesn't support plugin API version %d.\n"
@@ -1106,8 +1119,13 @@ demux_plugin_t *init_demuxer_plugin(int iface, xine_t *xine) {
return NULL;
}
- this = xine_xmalloc (sizeof (demux_avi_t));
- config = xine->config;
+ this = xine_xmalloc (sizeof (demux_avi_t));
+ this->config = xine->config;
+
+ (void*) this->config->register_string(this->config,
+ "mrl.ends_avi", VALID_ENDS,
+ "valid mrls ending for avi demuxer",
+ NULL, NULL, NULL);
this->demux_plugin.interface_version = DEMUXER_PLUGIN_IFACE_VERSION;
this->demux_plugin.open = demux_avi_open;