comparison stream/stream_dvd.c @ 29041:1b8e2b6fa928

Simplify detection of .ifo extension.
author reimar
date Fri, 27 Mar 2009 21:26:26 +0000
parents a39df27439b9
children 3dcad5e40995
comparison
equal deleted inserted replaced
29040:963f578121c6 29041:1b8e2b6fa928
1095 static int ifo_stream_open (stream_t *stream, int mode, void *opts, int *file_format) 1095 static int ifo_stream_open (stream_t *stream, int mode, void *opts, int *file_format)
1096 { 1096 {
1097 char *ext; 1097 char *ext;
1098 char* filename; 1098 char* filename;
1099 struct stream_priv_s *spriv; 1099 struct stream_priv_s *spriv;
1100 1100 int len = strlen(stream->url);
1101 ext = strrchr (stream->url, '.'); 1101
1102 if (!ext || strcasecmp (ext + 1, "ifo")) 1102 if (len < 4 || strcasecmp (stream->url + len - 4, ".ifo"))
1103 return STREAM_UNSUPPORTED; 1103 return STREAM_UNSUPPORTED;
1104 1104
1105 mp_msg(MSGT_DVD, MSGL_INFO, ".IFO detected. Redirecting to dvd://\n"); 1105 mp_msg(MSGT_DVD, MSGL_INFO, ".IFO detected. Redirecting to dvd://\n");
1106 1106
1107 filename = strdup(basename(stream->url)); 1107 filename = strdup(basename(stream->url));