summaryrefslogtreecommitdiffstats
path: root/sub/find_subfiles.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix some cppcheck / scan-build warningswm42013-05-061-1/+0
| | | | | | | | These were found by the cppcheck and scan-build static analyzers. Most of these aren't interesting (the 2 previous commits fix some interesting cases found by these analyzers), and they don't nearly fix all warnings. (Most of the unfixed warnings are spam, things MPlayer never cared about, or false positives.)
* path: add mp_find_config_file and reorganize some of the codeStefano Pigozzi2012-12-151-2/+2
| | | | | | | | | | | | | | Add `mp_find_config_file` to search different known paths and use that in ass_mp to look for the fontconfig configuration file. Some incidental changes spawned by this feature where: * Buffer allocation for the strings containing the paths is now performed with talloc. All of the allocations are done on a NULL context, but it still improves readability of the code. * Move the OSX function for lookup inside of a bundle: this code path was currently not used by the bundle generated with `make osxbundle`. The plan is to use it again in a future commit to get a fontconfig config file.
* sub: remove vobsub reader in favor of ffmpeg vobsub demuxerwm42012-12-111-51/+2
| | | | | | | | ffmpeg recently added a demuxer that can read vobsubs (pairs of .sub and .idx files). Get rid of the internal vobsub reader, and use the ffmpeg demuxer instead. Sneak in an unrelated manpage change (autosub default).
* Rename directories, move files (step 2 of 2)wm42012-11-121-4/+4
| | | | | | | | | | | | Finish renaming directories and moving files. Adjust all include statements to make the previous commit compile. The two commits are separate, because git is bad at tracking renames and content changes at the same time. Also take this as an opportunity to remove the separation between "common" and "mplayer" sources in the Makefile. ("common" used to be shared between mplayer and mencoder.)
* options: remove subtitle related options that did nothingwm42012-10-241-0/+1
| | | | | | | Most of these cased working when the OSD was switched to libass, or didn't do anything even before that. Also don't recursively include subreader.h in sub.h.
* 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.