summaryrefslogtreecommitdiffstats
path: root/sub/find_subfiles.c
Commit message (Collapse)AuthorAgeFilesLines
* sub: silence output of subtitle search messagewm42012-07-301-1/+1
| | | | This message is not so interesting.
* bstr: rename bstr() function to bstr0(), and typedef bstr to struct bstrwm42012-07-281-13/+13
| | | | | Replace all uses of bstr() with bstr0(). Also remove the ridiculous C++ workaround.
* windows support: unicode filenameswm42012-03-091-0/+2
| | | | | | | | | | | | | | | | | | | Windows uses a legacy codepage for char* / runtime functions accepting char *. Using UTF-8 as the codepage with setlocale() is explicitly forbidden. Work this around by overriding the MSVCRT functions with wrapper macros, that assume UTF-8 and use "proper" API calls like _wopen etc. to deal with unicode filenames. All code that uses standard functions that take or return filenames must now include osdep/io.h. stat() can't be overridden, because MinGW-w64 itself defines "stat" as a macro. Change code to use use mp_stat() instead. This is not perfectly clean, but still somewhat sane, and much better than littering the rest of the mplayer code with MinGW specific hacks. It's also a bit fragile, but that's actually little different from the previous situation. Also, MinGW is unlikely to ever include a nice way of dealing with this.
* bstr: rename BSTR() -> bstr()Uoti Urpala2011-07-271-13/+13
| | | | | | Rename the BSTR() function to bstr(). The former caused a conflict with some Windows OS name, and it's no longer a macro so uppercase naming is less appropriate.
* find_subfiles: fix unintended modification of global filenameUoti Urpala2011-04-281-1/+1
| | | | | | | | | | Commit a2d28010cc ("cleanup: find_subfiles.c: simplify (mainly using bstr)") was missing a bstrdup() in subtitle search code, and thus the code erroneously modified the original filename string passed in. As a result anything which printed or otherwise used the filename after that would use a lowercase-converted version instead of the actual file name. Fix by adding the bstrdup() to operate on a local copy of the name instead.
* cleanup: find_subfiles.c: simplify (mainly using bstr)Uoti Urpala2011-04-201-156/+113
|
* cleanup: find_subfiles.c: simplify declarations and allocationsClément Bœsch2011-04-201-36/+25
| | | | | Also clarify compare_sub_priority() and remove a typedef for the subfn structure in the process.
* find_subfiles: select subtitle files matching -slangClément Bœsch2011-04-201-57/+59
| | | | Also simplify subtitle selection a bit.
* find_subfiles: try to determine if a .sub file is text or vobsubClément Bœsch2011-04-201-0/+14
| | | | | | | A file with the ambiguous extension .sub could be either VOBsub or MicroDVD. If there's a corresponding .idx file it's certainly VOBsub, so don't add it to the list of potential text subtitles. This will avoid the annoying warning "SUB: Could not determine file format".
* subs: options: add -sub-pathsClément Bœsch2011-04-201-3/+25
|
* find_subfiles: allow subtitle search in multiple directoriesClément Bœsch2011-04-201-117/+103
|
* subs: move vobsub loading logic down to find_subfiles.cUoti Urpala2011-04-201-0/+25
| | | | | | | Analogously to the previous commit, move path handling logic for loading external vobsub files from mplayer.c to find_subfiles.c. Based on a commit from Clément Bœsch but fixed and simplified.
* subs: move text sub loading logic down to find_subfiles.cClément Bœsch2011-04-201-1/+10
| | | | | | Move path handling for loading external subtitle files from mplayer.c to find_subfiles.c. Now the remaining code in mplayer.c only gets a list of potential filenames and tries opening those.
* find_subfiles: move sub_filenames() hereClément Bœsch2011-04-201-0/+271
Move sub_filenames() and related code from subreader.c to new file find_subfiles.c. This function is used to find subtitle files that should be loaded for the current video; this functionality is not specific to the particular kind of text subtitle handling implemented in subreader.c. Also reindent and prettify the moved code a bit.