| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now it depends on the command whether a property wraps around, or stops
at min/max valid property value.
For practically all properties, it's quite unambiguous what the "switch"
command should have done, and there's technically no need to replace it
with these new commands. More over, most properties that cycle are
boolean anyway. But it seems more orthogonal to make the difference
explicit, rather than hardcoding it. Having different commands also
makes it more explicit to the user what these commands do, both just due
to the naming, and what wrapping policy is used. The code is simpler
too.
|
|
|
|
|
|
|
|
| |
Move the code for "switch_ratio" to the M_PROPERTY_SET case of the
"aspect" property. The rules are exactly the same, e.g. setting a ratio
smaller than 0.1 sets the pixel aspect ratio to 1:1. For now, we define
that writing "0" sets the PAR to 1:1, and disallow -1 (possibly reserve
it to reset to default aspect ratio).
|
|
|
|
|
|
| |
Instead, communicate the new value range with M_PROPERTY_GET_TYPE. Add
M_PROPERTY_GET_WRAP to allow properties to enable cycling instead of
stopping at min/max.
|
|
|
|
|
| |
Change the type of the arg for this action from m_option** to m_option*.
This makes it easier to change some aspects of the option dynamically.
|
| |
|
|
|
|
|
|
|
|
| |
This should be done by mp_property_generic_option() only. Also reindent
levels_property_helper() to make it a little bit more readable.
Remove the m_option_get_ptr() function, which doesn't really make sense
anymore.
|
|
|
|
|
|
|
|
|
| |
The Doxygen-style documentation comments were nothing but bloat.
Also move mp_property_do() and mp_property_print() to command.h, where
they should belong, and fix their argument types. m_property.c/h is
supposed to be generic, while command.h provides declarations specific
to the mplayer core.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make more properties use the property-to-option bridge to reduce code
size and to enforce consistency. Some options are renamed to the same
as the properties (the property names are better in all cases).
Do some other minor cleanups. One bigger issue was memory management of
strings: M_PROPERTY_TO_STRING assumed the strings were statically
allocated, and no dynamic allocations could be returned. Fix this in
case the need for such properties arises in the future. Get rid of
m_property_string_ro(), because it's not always clear that the "action"
parameter is M_PROPERTY_SET and the string argument will be used.
|
|
|
|
| |
Also remove two slave mode messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of clamping property values to the valid range in each property
implementation, handle it in the property layer. The functionality to
handle clamping for each type is in m_option.c.
It's not really clear whether this is really needed. Normally, the raw
values for M_PROPERTY_SET come only from m_option_type.parse (setting
properties as string) or from m_option_parse.add (using the "switch"
input command). However, since this was already done before, and since
we _really_ want to be sure only to write valid values, add this code
anyway. The newly added warnings/error messages should never actually
be printed during normal operation and are for debugging (if they
happen, we definitely want to see them).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the m_option code by default to format property values, instead of
having separate code in m_property.
To facilitate that, add a pretty_print callback to option types. These
format values in a more human readable and user friendly way, as opposed
to the print callback, which produces parseable values.
This also changes the strings used with flags. Instead of "enabled" and
"disabled", flags are formatted as "yes" and "no". (We could use the
pretty_print callback to deal with this, but we don't for consistency.)
|
|
|
|
|
|
| |
Most property implementations checked whether the "arg" parameter was
NULL. This is entirely pointless, because NULL is actually never pased.
It was inconsistently done, too. Remove the checks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of forcing each property implementation implement its own logic
for M_PROPERTY_STEP_UP/M_PROPERTY_STEP_DOWN, handle it in the generic
property code.
Rename the M_PROPERTY_STEP_UP command to M_PROPERTY_SWITCH (the other
property command, M_PROPERTY_STEP_DOWN, isn't needed anymore: stepping
downwards is done by passing a negative argument). Always use double as
argument type; it makes the code easier, and covers all property types.
Move the code which does the actual type-specific value stepping to
m_option.c (the idea is that m_option handles types).
Some properties still have custom handlers implemented with
M_PROPERTY_SWITCH. They can't be mapped to the generic mechanism,
because their value range is dynamic or entirely unknown.
For some properties, the default step stride is changed to 1. This is no
issue, because the default bindings in input.conf all use an explicit
stride in the affected cases.
|
|
|
|
|
|
|
|
|
| |
This was the option parser for the off_t C type. These days, off_t is
always int64_t, so replace all its uses by int64_t and CONF_TYPE_INT64.
Fix the --sstep option. It used CONF_TYPE_INT with an off_t variable,
which will result in invalid memory accesses. Make it use type double
instead, which seems to make more sense for this option.
|
|
|
|
|
|
|
|
|
| |
Rename both the option and property to "osd-level", which fits a bit
better with the general naming scheme. Make it a choice instead of an
integer range. I failed to come up with good names for the various
levels, so leave them as-is.
Remove the useless property handler for the "loop" property too.
|
|
|
|
|
|
|
|
|
|
| |
Replace --hardframedrop with --framedrop=hard. Rename the framedrop
property from "framedropping" to "framedrop" for the sake of making
command line options have the same name as their corresponding
property. Change the property to accept choice values instead of
numeric values.
Remove unused/forgotten auto_quality variable.
|
|
|
|
|
| |
This could change the direction (i.e. invoke STEP_PROPERTY_DOWN), but
you can just pass a negative value as second argument instead.
|
|
|
|
|
|
|
|
|
|
|
|
| |
osd_show_[property_]text => show_text
osd_show_progression => show_progress
show_text, osd_show_property_text and osd_show_text both map to the
code for the previous osd_show_property_text. The only special thing
about osd_show_text is that you don't need to escape "$". Also,
unfortunately osd_show_property_text requires escaping things twice,
one time for the command parser, and the other time for the property
formatting code, while osd_show_text needed only one level of escaping.
|
|
|
|
| |
Redundant with set/switch commands.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use "-" instead of "_" in property names. The intent is that property
names and options names should be the same (if they refer to the same
thing), and options use "-" as word separator.
Rename some other properties too, e.g. "switch_audio" -> "audio".
Add a way to translate the old property names to the new ones, similar
to the input command legacy bridge.
Update input.conf. Use the new property names, and don't use legacy
commands.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most input commands had their own policy whether to display an OSD
message for user feedback or not. Some commands had two variants, one
that showed an OSD message and one that didn't (e.g. step_property_osd
and step_property).
Change it such that all commands show a message on the OSD. Add a
"no-osd" modifier that disables OSD for that command. Rename the
"step_property" and "step_property_osd" command to "switch", and rename
"set_property" and "set_property_osd" to "set".
Note that commands which haven't used OSD before still don't use OSD.
That will possibly be fixed later. (E.g. "screenshot" could display an
OSD message instead of just printing a message on the terminal.)
The chapter and edition properties still produce OSD messages even with
"no-osd", because they don't map so well to the property_osd_display[]
mechanism.
|
|
|
|
|
|
| |
Make the definition more compact and less confusing by omitting rarely
used fields. Avoid having to initialize osd_id with -1 in every entry
by making 0 an unused OSD ID instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are many input commands which are redundant to properties. They
were parsed like normal commands, but set_property_command() in
command.c handled them automatically using the property mechanism. This
still required having the command specifications around, and the code in
command.c was quite messy.
Replace this with a text based replacement mechanism. Some corner cases
are not handled: commands of form "seek_chapter 3 1" are supposed to set
the "chapter" property to 3. This use is probably rare, and doesn't show
up in the default input.conf.
The reason compatibility is kept is because breaking input.conf is quite
annoying, so a minimal effort is made to avoid this. Currently we print
an annoying warning every time a legacy command is used, though.
Also add a compatibility entry for "pt_step", which was removed some
time ago. Variations in whitespace are not handled, but it's good enough
to deal with old input.conf entries.
|
|
|
|
|
|
|
|
| |
These have been replaced by properties. Also remove some other slave-
mode specific get commands that can be replaced by property uses.
The get_metadata() function didn't actually contain anything useful,
and just replicated code from other parts of mplayer.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The --loop option takes slightly different parameters now. --loop=0
used to mean looping forever. Now it means looping is disabled (this is
more logical: 2 means playing 2 more times, 1 means playing 1 more time,
and 0 should mean playing not again).
Now --loop=inf must be used to enable looping forever.
Extend choice types to allow an optional range of integers as values.
If CONF_RANGE is added to the flags of a m_option_type_choice option,
m_option.min/max specify a range of allowed integer values. This can be
used to remove "special" values from make integer range options. These
special values are unintuitive, and sometimes expose mplayer internals
to the user. The (internal) choice values can be freely mixed with the
specified integer value range. If there are overlaps, the choice values
are preferred for conversion to/from strings.
Also make sure the extension to choice options works with properties.
Add the ability to step choice properties downwards, instead of just
upwards.
|
|
|
|
|
|
| |
It can't be re-implemented, because this isn't supported by libass. The
-subalign option and the associated sub-align slave property did
nothing. Remove them.
|
|
|
|
|
| |
This was an on-going transition to make mplayer format all times in the
same format.
|
|
|
|
|
|
| |
This was destroyed by Uoti Urpala in commit "subs: always use sub...".
Features should be either kept working or completely removed, but not
just crippled, which only inflates the code and frustrates users.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove subtitle selection code setting osd->ass_track directly and
vf_ass/vf_vo code rendering the track directly with libass. Instead,
do track selection and rendering with dec_sub.c functions.
Before, mpctx->set_of_ass_tracks[] contained bare libass tracks
generated from external subtitle files. For use with dec_sub.c, it now
contains struct sh_sub instances with decoder already initialized.
This commit breaks the sub_step command ('g' and 'y' keys) for
libass-rendered subtitles. It could be fixed, but it's so useless -
especially as with the existing implementation there's no practical
way to get subtitle delay back to normal after using it - that I
didn't bother.
Conflicts:
command.c
mp_core.h
mplayer.c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To draw libass subtitles, the code used ASS_Renderer objects created
in vf_vo (VO rendering) or vf_ass. They were destroyed and recreated
together with the video filter chain. Change the code to use a single
persistent renderer instance stored in the main osd_state struct.
Because libass seems to misbehave if fonts are changed while a
renderer exists (even if ass_set_fonts() is called on the renderer
afterwards), the renderer is recreated after adding embedded fonts.
The known benefits are simpler code and avoiding delays when switching
between timeline parts from different files (libass fontconfig
initialization, needed when creating a new renderer, can take a long
time in some cases; switching between files rebuilds the video filter
chain, and this required recreating the renderers). On the other hand,
I'm not sure whether this could cause inefficient bitmap caching in
libass; explicitly resetting the renderer in some cases could be
beneficial. The new code does not keep the distinction of separate
renderers for vsfilter munged aspect vs normal; this means that
changing subtitle tracks can lose cache for the previous track.
The new code always sets some libass parameters on each rendering
call, which were previously only set if they had potentially changed.
This should be harmless as libass itself has checks to see if the
values differ from previous ones.
Conflicts:
command.c
libmpcodecs/vf_ass.c
libmpcodecs/vf_vo.c
mplayer.c
sub/ass_mp.c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new slave property which switches the current Matroska edition.
Since each edition can define an entirely new timeline, switching the
edition will simply restart playback at the beginning of the file with
the new edition selected.
Add 'E' as new keybinding to step the edition property.
DVD titles are still separate. Apparently they work similarly, but I
don't have any multi-title DVDs for testing. Also, cdda (for audio CDs)
uses the same mechanism as DVDs to report a number of titles, so there
seems to be confusion what exactly this mechanism is supposed to do.
That's why the edition code is completely separate for now.
Remove demuxer.num_titles. It was just a rather useless cache for the
return value of the DVD titles related STREAM_CTRL.
One rather obscure corner case isn't taken care of: if the ordered
chapters file has file local options set, they are reset on playback
restart. This is unexpected, because edition switching is meant to
behave like seeking back to the beginning of the file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a general track struct for every audio/video/subtitle track
known to the frontend. External files (subtitles) are now represented
as tracks too. This mainly serves to clean up the subtitle selection
code: now every subtitle is simply a track, instead of using a messy
numbering that goes by subtitle type (as it was stored in the
global_sub_pos field). The mplayer fontend will list external subtitle
files as additional tracks.
The timeline code now tries to match the exact demuxer IDs of all
tracks. This may cause problems when Matroska files with different
track numberings are used with EDL timelines. Change demux_lavf not
to set demuxer IDs, since most time they are not set.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Whenever the demuxer is accessed to retrieve metadata, use the newly
introduced master_demuxer field instead. If a timeline is used, the
master_demuxer will still refer to the main file, instead to segments.
Instead of mpctx->demuxer->stream, access mpctx->stream; even though
they are the same, the code becomes shorter. For the TV code, introduce
a function get_tvh() to access the TV handle, instead of duplicating the
code all over the place. Often the demuxer field is checked to determine
whether something is currently played; prefer other methods over that.
Note that the code before always accessed the current timeline segment,
and would e.g. read file metadata of the current segment. Now it always
returns metadata for the master file. This may have various wanted and
unwanted effects.
|
|
|
|
|
|
|
| |
This messes deeply with the subtitle bookkeeping data structures, and
would have to be reimplemented anyway.
It's not sure what this was even useful for. Possibly for slave mode.
|
|
|
|
|
| |
Not very useful, and introduced special cases. Just get rid of it, can
be reintroduced if in a better way if someone misses this feature.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the internal mplayer MPEG demuxer was removed (commit 1fde09db),
the default demuxer when using dvdnav was set to libavformat. Now it
turns out that this doesn't work with libavformat. It will terminate
playback right after the audio runs out (instead of looping it like the
video, or whatever it's supposed to do). I'm not sure what exactly the
problem is, but since 1. even mplayer-svn can't handle DVD menus
directly (missing highlights), 2. DVD menus are essentially worthless,
and 3. I don't directly watch DVDs, don't bother with it and remove it.
For basic playback, there's still libdvdread support.
Also, use pkg-config for libdvdread, and drop support for in-tree
libdvdread. Remove support for in-tree libdvdcss as well.
|
|
|
|
|
|
|
|
|
|
| |
Change "run" command to expand properties.
Patch by Jan Christoph Uhde [Jan UhdeJc com], documentation
part changed by me.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35081 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
|
|
|
|
|
| |
Commit ebaaa41f2a4 accidentally removed the final terminator of the
properties array.
|
|
|
|
|
|
|
|
|
| |
Commit 9c02ae7e9510897 set the sh variable (see diff) to the struct of
type sh_sub instead the one of sh_stream. Unfortunately this didn't
crash, and merely made the OSD show "unknown" for the language.
Commit 804bf91570a24b9 accidentally removed the display of the track
title. Add it back.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|