| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The entries of a playlist file usually refer either to local files (in
the same directory as the playlist), or absolute paths like URLs. In
the first case, you want to add the base path of the playlist file to
the files, so that mplayer can find the files. In the second case, the
URLs should not be changed.
Unfortunately, mp_path_join() recognizes URLs as relative paths, and
changes them. E.g. it tried to play /path/to/playlist/http://entry.
Add some code to deal with this properly. The added code uses the same
approach as m_option_type_custom_url in m_option.c, but because it's
so short and trivial, it's perhaps better not to rely on the option
parser code.
It's also unclear whether mp_path_join() should contain this logic,
but maybe it's better to keep the logic of that function clean.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Skipping past the last chapter as user action means playback of the
current file should be ended. The code did this by doing a relative
seek by 1000000000 seconds, which usually caused playback to stop.
However, it displayed a quite ugly and arbitrary looking number in the
status display.
Fix this by explicitly skipping to the next file, instead of issuing a
seek command. (If there is no next file, the player will exit, just as
before.)
(Note: an alternative way to solve this could have been comparing the
mpctx->video_pts with the mpctx->last_seek_pts in print_status(). If
they're the same, it's likely that the video_pts was set to the seek
request time, and we could print another PTS or no PTS instead.)
|
|
|
|
|
|
| |
This code has never been active by default, ever since it was added
back in 2001. You had to edit config.h or configure manually to enable
it.
|
|
|
|
|
|
|
|
|
|
| |
osd_libass.c used the same ASS_Library object as the player core. This
caused a problem: when playing a new file, all fonts loaded by the
ASS_Library object were unloaded, including the OSD font. Parts of the
OSD would stop being rendered correctly.
Solve this by creating a separate ASS_Library, with its own set of
fonts.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 168293e0ae6f08 assumed the OSD drawing routines (which have the
functions osd_draw_text/_ext as entrypoint) would always be called, and
relied on that to reset the change flag.
Some VOs, such as vo_null, didn't do this. Pausing could turn into
endless framestepping in some cases. Restore the part of the OSD drawing
logic that dealt with this. (Alternatively, the VOs could be obliged to
always call the OSD drawing routines, even if the VO doesn't actually
draw the OSD. But it seems even more messy to rely on that.)
|
|
|
|
|
|
|
| |
This transition to a new VO API started over 4 years ago. It's time to
finally end it, and get rid of the horrible hacks.
Also removes some previously undetected dead code from spudec.c.
|
|
|
|
|
|
|
|
| |
The only reason the old VO related header old_vo_defines.h was included
was probably to gain access to the current VO struct in the function
change_movie_aspect(). Make that function take a parameter instead.
This function seems to be unused.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The commit 74df1d8e05aa2 (and f752212c62353) replaced the configure
endian check with byte order macros defined by standard headers. It
turns out that MinGW-w64 actually doesn't define these macros in the
sys/types.h system header. (I assumed it does, because a quick test
seemed to work. But that was because gcc -W -Wall doesn't warn against
undefined macros. You need -Wundef for that.) MinGW-w64 has a
sys/params.h header defining these macros, but sys/types.h doesn't
include it, so it's useless without special casing the mplayer code.
Add a hack top configure instead. Define the macros directly, and
assume MinGW-w64 only works on little endian machines.
The other changes are basically random typos and superficial oversights.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The removed VO and AO took MPEG data and decoded it with V4L2. I'm not
exactly sure what's the use of this today, but get rid of it.
As far as feeding video data to V4L2 is concerned, there are other
ways. For example, there is this script, that feeds yuv4mpeg formatted
raw video data to V4L2:
https://raw.github.com/umlaeute/v4l2loopback/master/examples/yuv4mpeg_to_v4l2.c
|
|
|
|
|
| |
Actually, this is probably completely broken, and there are better
ways to get mplayer output into a V4L2 device.
|
| |
|
|
|
|
|
|
| |
No effort was put into moving static variables into a priv struct. The
VO wasn't tested, because DirectFB's X11 backend didn't work for me (it
crashed, not just with mplayer, but also SDL applications).
|
|
|
|
| |
This also involves moving the static variables into a priv struct.
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is lots of badly and inconsistently formatted code left, which
leaves us with the frequent need for cleaning up. This uncrustify
profile can be used for automatic reformatting. The author of this file
is (perhaps) uau.
It's different from mplayer-svn's TOOLS/mp-uncrustify-style.cfg. The
differences and origins of these files are unclear, but the file added
with this commit is probably more consistent with the heavily cleaned
up areas of mplayer2 and this fork.
|
| |
|
|
|
|
|
|
|
| |
Although slightly less precise, this sounds less clunky.
This change also causes the --screenshot-filetype option to be renamed
to --screenshot-format.
|
|
|
|
| |
This was used by stream/tvi_v4l.c, which was removed a while ago.
|
|
|
|
|
|
|
|
| |
The encoding branch by divverent can handle of these via libavformat.
Note: for some reason, libav/ffmpeg have a GIF muxer only, and no
demuxer. The gif configure checks needef for the mplayer internal gif
demuxer can't be removed yet.
|
|
|
|
| |
All of these have been replaced by vo_image.
|
|
|
|
|
| |
The function checked_mkdir is taken from vo_jpeg, with the error
handling stripped down to a reasonable level.
|
|
|
|
| |
This is supposed to replace vo_png and others.
|
| |
|
|
|
|
|
|
| |
Most of these are useless or probably even dangerous. Support them
anyway, because it's easy, and we want to replace vo_jpeg without any
disadvantages.
|
|
|
|
|
|
| |
For getting rid of vo_tga.
This makes use of the libavcodec TGA encoder.
|
|
|
|
|
|
|
|
|
|
| |
While the PNM formats are not that useful, supporting them helps
getting rid of vo_pnm.
This makes use of the libavcodec PNM encoder.
Compared to vo_pnm, at least PNM ASCII mode is not supported. It doesn't
look like libavcodec supports this mode for encoding.
|
|
|
|
|
| |
image_writer now provides its own option parsing, and screenshot.c and
the mplayer frontend use it.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Given your option struct has a field that is a pointer to another
struct, this commit allows you to declare options that write into that
other struct. The code in m_config will dereference the pointer field
on its own if such an option is accessed. If the field is NULL on
initialization of the containing m_config, the struct is automatically
allocated.
OPT_SUBSTRUCT() can be used to declare such a field.
struct m_sub_options is used to describe the pointed-to struct, and
includes size and defaults if the struct has to be allocated by
m_config.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
M_OPT_PREFIXED allows adding top-level options with the suboption
mechanism. The point of this is that, even though these options are
top-level options, they don't need to be added directly to a top-
level option array (such as mplayer_opts[]). Instead, the suboption
can be defined in a separate source file. Only a suboption declaration
is needed to add these options.
M_OPT_MERGE is similar to M_OPT_PREFIXED, but doesn't add the name of
the suboptions entry as prefix.
Given you have a suboption declaration "prefix" and the suboption
"subopt", you can pass them as follows on the command line:
normal: --prefix=subopt=value
M_OPT_PREFIXED: --prefix-subopt=value
M_OPT_MERGE: --subopt=value
|
|
|
|
|
|
|
|
|
| |
Doesn't make sense because we broke/are going to break compatibility
with everything anyway.
Remove mechanism for warning the user against disabled options.
Remove colorspace alternative option values.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Options parsing used to be ambiguous, as in the splitting into option
and values pairs was ambiguous. Example:
-option -something
It wasn't clear whether -option actually takes an argument or not. The
string "-something" could either be a separate option, or an argument
to "-option". The code had to call the option specific parser function
to resolve this.
This made everything complicated and didn't even have a real use. There
was only one case where this was actually used: string lists
(m_option_type_string_list) and options based on it. That is because
this option type actually turns a single option into a proxy for several
real arguments, e.g. "vf*" can handle "-vf-add" and "-vf-clr". Options
suffixed with "-clr" are the only options of this group which take no
arguments.
This is ambiguous only with the "old syntax" (as shown above). The "new"
option syntax always puts option name and value into same argument.
(E.g. "--option=--something" or "--option" "--something".)
Simplify the code by making it statically known whether an option takes
a parameter or not with the flag M_OPT_TYPE_OLD_SYNTAX_NO_PARAM. If it's
set, the option parser assumes the option takes no argument.
The only real ambiguity left, string list options that end on "-clr",
are special cased in the parser.
Remove some duplication of the logic in the command line parser by
moving all argument splitting logic into split_opt(). (It's arguable
whether that can be considered code duplication, but now the code is a
bit simpler anyway. This might be subjective.)
Remove the "ambiguous" parameter from all option parsing related code.
Make m_config unaware of the pre-parsing concept.
Make most CONF_NOCFG options also CONF_GLOBAL (except those explicitly
usable as per-file options.)
|
|
|
|
| |
This was unused.
|
|
|
|
|
| |
This means these key binding will basically not exist, unless dvdnav is
in use (at runtime).
|
|
|
|
|
|
|
|
| |
free() was used before, which could in theory lead to crashes if
the OSD buffer was freed or resized. (Whether using free() actually
works depends on what function libavutil's av_malloc() uses internally.
On Linux, it seems to use memalign(), which uses free() as counterpart
for deallocation, so the bug never triggered for me.)
|
|
|
|
|
|
|
|
|
|
| |
Now the command line parser sets the m_config object into file local
mode, so that m_config can check for this condition. Makes trying to
set global options from a profile fail.
Note: global options can be considered read-only by m_config, so maybe
there should be an additional check for this. Reusing the file-
local check is more practical for now, though.
|
|
|
|
|
|
|
| |
This was already treated like CONF_GLOBAL.
Profiles can actually be file-local, as long as the profile sets file
local options only. Allow them to do so.
|
|
|
|
|
| |
Also change m_config_simple() such that you need to register options
using m_config_register_options().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 48f0692ab9 "options: make option struct the talloc parent of options".
This made things actually more complicated. It introduced a new
parameter to the option parse and copy functions, which was used
inconsistently. Some code passed a parent, some not. Morever, you have
to call m_option_free() anyway, because not all options actually
respect the talloc parent. There is also the question whether passing
NULL as parent is supposed to work, or if you still have to implement
m_config_free().
On the other hand, this simplifies nothing. I assume the intention was
being able to free all option values with a single talloc_free() call,
but the same goal can be reached by simply freeing the m_config struct.
(The m_config talloc destructor will free each option values.)
Get rid of the talloc parent context parameter. This essentially
reverts commit 48f0692ab9 ("options: make option struct the talloc parent of options").
In video_out.c, make the VO priv struct the talloc parent for the
m_config object, so that destroying the VO will free the options.
The ability to free the m_config struct and all its managed options was
introduced in commit 89a17bcda6c.
|
|
|
|
|
|
|
|
|
| |
This also requires that the OSD stack related functions carry a pointer
to MPContext.
Free the OSD stack items (mp_osd_msg) at exit by making MPContext the
talloc parent. (E.g. when exiting while something is still displayed on
the OSD.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The only place exit_player() should be called is the main() function.
exit_player() should be the only function allowed to call exit(). This
makes it easier to guarantee proper deinitialization, and allows using
the --leak-report flag without showing false positives.
The quit slave command now sets a flag only. It uses the same mechanism
that's normally used to advance to the next file on the playlist, so the
rest of the playback path should be able to react to the quit command
quickly enough. That is, the player should react just as fast to quit
requests in practice as before this commit.
In reinit_audio_chain(), the player was actually exited if
init_audio_filters() failed. Reuse the normal error handling path to
handle this condition.
|
| |
|
|
|
|
| |
This is a regression introduced by commit 9c02ae7e95108.
|
|
|
|
|
| |
Other (newer) parts of mplayer use this convention, so don't introduce
new conventions.
|
|
|
|
|
|
|
| |
The print_timeline() function actually had contained some code that
changed the MPContext state. Since you wouldn't expect that from a
function named print, move that code out of the function. The
misleading code structure was introduced in commit 6f564fe82b.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 89a17bcda6c16 simplified the idle loop to run any commands
mplayer receives, not just playlist related commands. Unfortunately, it
turns out many slave commands always assume the presence of a demuxer.
MPContext->demuxer is assumed not to be NULL. This made the player
crash when receiving slave commands like pause/unpause, chapter
control, subtitle selection.
We want mplayer being able to handle this. Any slave command or
property, as long as it's backed by a persistent setting, should be run
successfully, even if no file is being played. If the slave command
doesn't make sense in this state, it shouldn't crash the player.
Insert some NULL checks when accessing demuxers. If sh_video or
sh_audio are not NULL, assume demuxer can't be NULL.
(There actually aren't that many properties which need to be changed. If
it gets too complicated, we could employ alternative mechanisms instead,
such as explicitly marking safe properties with a flag.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are different C types for each stream type: sh_video for video,
sh_audio for audio, sh_sub for sub. There is no type that handles all
stream types in a generic way. Instead, there's a macro SH_COMMON, that
is used to define common fields for all 3 stream structs. Accessing
the common fields is hard if you want to be independent from the stream
type.
Introduce an actual generic stream struct (struct sh_stream), which is
supposed to unify all 3 stream types one day. Once all fields defined
by SH_COMMON have been moved into sh_stream, the transition is complete.
Move some fields into sh_stream, and rewrite osd_show_tracks to use
them.
|
|
|
|
|
|
|
|
|
|
|
| |
mp_property_audio switched the audio stream, but didn't store the newly
requested audio ID to MPOpts.audio_id, which is used by --aid. This
meant that the audio track would be reset when advancing to a new file.
Change that to make it consistent with subtitle selection. (Whether this
behavior is a good idea or not is a different question - maybe it's not
a good idea, because tracks are essentially random, and this will
disable default selection of tracks.)
|
|
|
|
|
|
|
| |
The SH_COMMON lang field seems to be blatantly unreliable and is not
always set by demux_lavf (at least not with dvdnav:// ).
Also fix the same for the show_tracks_osd slave command.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The structure is now as follows:
- main():
* basic initializations (e.g. init_libav() and more)
* pre-parse command line (verbosity level, config file locations)
* load config files (parse_cfgfiles())
* parse command line, add files from the command line to playlist
(m_config_parse_mp_command_line())
* call:
- handle_help_options():
* check each help-related option
* print help if requested
* main() exits if help was requested
* call function that works down the playlist:
- play_files():
* run idle loop (idle_loop()), until there are files in the
playlist or an exit command was given (slave mode only)
* actually load and play a file:
- play_current_file():
* run all the dozens of functions to load the file
and initialize playback
* run a small loop that does normal playback, until
the file is done or a slave command terminates
playback
(each iteration, run_playloop() is called)
* uninitialize playback
* determine next entry on the playlist to play
* loop
* call exit_player_with_rc() (there are many other places which
use this function, though)
|
|
|
|
|
|
|
| |
The main() function used to be way too big, to the point that it was
unreadable (> 1000 lines).
Move random parts out of the main into new functions.
|
| |
|
|
|
|
| |
This sin was committed in 2002.
|
|
|
|
|
|
|
|
|
< |