| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
NULL pointer deref when a .sub file with the same filename as the video
file was present.
I was probably half asleep when writing this code.
|
|
|
|
|
|
|
| |
This could lead to a segfault, fixes #219
Signed-off-by: Gabriel Peixoto <gabrielrcp@gmail.com>
Signed-off-by: wm4 <wm4@nowhere>
|
|
|
|
|
|
|
|
|
|
|
| |
Even if a subtitle was explicitly loaded with -sub, it was still auto-
loaded (if auto-loading applied to that file). Fix this by explicitly
checking whether a file is already loaded.
The check is maximal naive and just compares the filenames as strings.
The change in find_subfiles.c is so that "-sub something.ass" happens to
work (auto-loading prepended a "./" to it, so the naive filename
comparison check didn't work).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
External vobsubs usually come as .idx/.sub pairs. Loading the .idx file
implicitly loads the .sub file, whereas loading the .sub file will kind
of work, but miss important information such as subtitle resolution. Or
in other words, if the .idx file exists, adding the .sub file as track
is useless and confusing.
Explicitly remove .sub file from the auto-load suntitle list in these
cases. Standalone .sub files are still loaded.
We also drop that weird logic that excluded .utf8 files from being
loaded if -subcp was in use. I hope the associated use case didn't make
much sense to begin with. If not, we could still implement it properly,
instead of this weird hack.
|
|
|
|
|
|
|
| |
Remove a crap assert() (what... either it can't happen, or it should
error or at least abort() if it can't be handled).
Remove some dead definitions.
|
|
|
|
|
|
|
| |
Use mp_path_exists() to check for existence of a file (which in turn
uses stat()), instead of opening and closing it. The difference is that
if we don't have sufficient permissions to read the subtitle files, we
will loudly complain. Personally, I prefer this behavior.
|
|
|
|
|
| |
Did things like opendir("http://..."). Makes no sense, and just
generates noise.
|
|
|
|
| |
Followup commit. Fixes all the files references.
|
| |
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This message is not so interesting.
|
|
|
|
|
| |
Replace all uses of bstr() with bstr0().
Also remove the ridiculous C++ workaround.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Also clarify compare_sub_priority() and remove a typedef for the subfn
structure in the process.
|
|
|
|
| |
Also simplify subtitle selection a bit.
|
|
|
|
|
|
|
| |
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".
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
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.
|