summaryrefslogtreecommitdiff
path: root/src/libw32dll/common.c
blob: 35fe41941654dd0d9f4be35f306d97ee7b8f5491 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif

static char *get_win32_codecs_path(config_values_t *cfg) {
  DIR                *dir;
  char               *path, *cfgpath;
  char               *listpath[] = { "",
                                     "/usr/lib/codecs", 
                                     "/usr/local/lib/codecs",
                                     "/usr/lib/win32",
                                     "/usr/local/lib/win32",
                                     NULL };
  int                 i = 0;

  cfgpath = cfg->register_filename (cfg, "decoder.external.win32_codecs_path", WIN32_PATH, XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
					 _("path to Win32 codecs"),
					 _("If you have the Windows or Apple Quicktime codec packs "
					   "installed, specify the path the codec directory here. "
					   "If xine can find the Windows or Apple Quicktime codecs, "
					   "it will use them to decode various Windows Media and "
					   "Quicktime streams for you. Consult the xine FAQ for "
					   "more information on how to install the codecs."),
					 10, NULL, NULL);

  while (listpath[i]) {
    if (i == 0) path = cfgpath;
    else path = listpath[i];

    if ((dir = opendir(path)) != NULL) {
      closedir(dir);
      return path;
    }

    i++;
  }

  return NULL; 
}