0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00
Commit Graph

242 Commits

Author SHA1 Message Date
wm4
39fc0060fb command: replace speed_mult with multiply command
The compatibility layer still takes care of the old speed_mult command.
2013-10-31 23:30:14 +01:00
wm4
71ded03123 command: add generic "multiply" command
Essentially works like "add".
2013-10-31 23:30:14 +01:00
wm4
94542abf2e command: add property to scale window size 2013-10-31 23:30:14 +01:00
wm4
53218f33b9 main: improve a terminal message
Better prefer real English...
2013-10-30 22:19:31 +01:00
wm4
2ccc3721ef player: merge mp_osd.h into mp_core.h
Just doing this because mp_osd.h and osd.c is not consistent.

There are some other header files (command.h and screenshot.h), but
since I don't feel too good about inflating mp_core.h, I'm not merging
them, at least not yet.
2013-10-30 22:19:31 +01:00
wm4
fdd1b8cac1 mp_core: sort function prototypes by source file
I considered making a header file for each .c file, but decided against
it. Asking around, not making separate headers was deemed acceptable. In
the end, all of these depend on MPContext and store state inside of it,
so separate headers aren't all that useful anyway.
2013-10-30 22:19:31 +01:00
wm4
b19414f3bf Split mplayer.c
mplayer.c was a bit too big. Split it into multiple files. I hope the
way it's split makes sense. Maybe some things don't make too much sense,
or go against intuition. These will fixed as soon as I notice them.

Some files are a bit questionable (misc.c, osd.c, configfiles.c), and
suggestions how to organize this better are welcome.

Regressions are possible due to reorganized include statements.
Obviously I didn't just copy mplayer.c's orgy of include statements, but
recreated them for each file. It's easily possible that there are
oversights and mistakes, which will show up on other platforms.

There is one actual change: the public avutil.h include is removed from
encode.h, and I tried to replace most FFMIN/FFMAX/av_clip uses. I
consider using libavutil too much as dangerous, because the set of
include files they recursively pull in is rather arbitrary and is
different between FFmpeg and Libav.
2013-10-30 01:53:53 +01:00
wm4
a84258d769 Move files part of the playback core to player sub-directory
All these files access mp_core.h and MPContext, and form the actual
player application. They should be all in one place, and separate
from the other sources that are mere utility helpers.

Preparation for splitting mplayer.c into multiple smaller parts.
2013-10-30 01:51:28 +01:00
wm4
40e68d6514 mplayer: handle subtitle renderer cleanup via uninit_player
This might actually fix an issue with DVB channel switching, because
that uses some sort of hack to reinitialize the demuxer, which causes
the subtitle renderer to initialize twice. As consequence, the assert in
add_subtitle_fonts_from_sources() would trigger.

I didn't actually test the DVB case, because I don't have the hardware.
2013-10-28 23:16:00 +01:00
wm4
5e9c226229 command: disable autorepeat for some commands (actually properties)
Disable autorepeat for the "add"/"cycle" commands when changing
properties that are choices (such as fullscreen, pause, and more).
In these cases, autorepeat is not very useful, and can rather harmful
effects (like triggering too many repeated commands if command
execution is slow).

(Actually, the commands are just dropped _after_ being repeated, since
input.c itself does not know enough about the commands to decide whether
or not they should be repeated.)
2013-10-28 00:33:52 +01:00
wm4
d2ee5c0330 command: don't include stream_dvd.h 2013-10-27 00:40:01 +02:00
wm4
7abc1bef40 af: replace macros with too generic names
Defining names like min, max etc. in an often used header is not really
a good idea.

Somewhat similar to MPlayer svn commit 36491, but don't use libavutil,
because that typically causes us sorrow.
2013-10-26 15:05:59 +02:00
Ben Boeckel
1fb1868afe mpvcore: add a note about desync on track switches 2013-10-26 12:37:42 +02:00
ChrisK2
c341edda35 osc: display cache status only below 45%
Turnes out, when playing stuff over WiFi, the cache may go below 48%
quite frequently.
2013-10-26 11:09:06 +02:00
ChrisK2
e02ec80192 osc: fix bug for no-duration cases 2013-10-26 11:08:06 +02:00
ChrisK2
c54335e7df osc: add experimental seekbar tooltip
Not up to my quality standards (need ASS boundingboxes), so disabled by default and undocumented for now.

Can be enabled with seektooltip=yes in plugin_osc.conf
2013-10-26 05:01:33 +02:00
ChrisK2
3a181bac1f osc: make sure the OSC actually fits into the video 2013-10-26 03:50:11 +02:00
wm4
ecc0705f83 options: don't let watch_later etc. overwite command line options
There are certain cases where mpv will automatically set options, such
as per-file configs, per protocol/VO/AO/extension profiles, and
watch_later resume configs. All these were overwriting the user's
options, even when they were specified on command line.

Add something that explicitly preserves command line options. This
means you can now actually use the command line to override any
options that the playback resume functionality backups and restores.

It still happily overrides options set at runtime (e.g. changed via
properties while playing a file; then playing the next file might
override them again), but maybe that's not a problem with typical use.
2013-10-25 22:52:54 +02:00
wm4
607892b741 mplayer: make --length relative to actual start of file, instead of 0
We always use the file's timestamps, so the start time can be easily
something different from 0. Make the --length option respect this.
2013-10-25 18:39:15 +02:00
wm4
2c6f6c9f4e m_config: slightly improve name handling 2013-10-25 18:39:15 +02:00
wm4
28d3fe1d6d m_config: remove unused fields
We don't need that anymore, because the old way to get default values
by recreating the m_config is gone.
2013-10-25 18:39:15 +02:00
wm4
75e1c6f295 m_config: allow not allocating option struct, and use it
In cases we're just listing options or checking their values (as it
happens with -vo/-vf etc. suboption parsing), we don't need to allocate
abd initialize the actual option struct. All we're interested in is
the list of options.
2013-10-25 18:39:15 +02:00
wm4
60aea74f44 m_config: refactor option defaults handling
Keep track of the default values directly, instead of creating a new
instance of the option struct just to get the defaults.

Also get rid of the special handling of m_obj_desc.init_options.
Instead, handle it purely by the option parser. Originally, I wanted to
handle --vo=opengl-hq and --vo=direct3d_shaders with this (by making
them aliases to the real VOs with a different preset), but since --vo
=opengl-hq=help prints the wrong values (as consequence of the
simplification), I'm not doing that, and instead use something
different.
2013-10-24 22:50:13 +02:00
wm4
f6bceacaff options: fix bogus entry
This didn't make sense and caused issues with the following commit: if
it's an option with a data pointer, it should be writable.
2013-10-24 22:50:13 +02:00
wm4
7204dee3c7 m_config: don't require dragging along parent in initialization
Instead, track the opstruct explicitly. It turns out we don't need the
parent at all. Also, add something rudimentary to track the default
values.
2013-10-24 22:50:13 +02:00
wm4
b707589e7e m_config: minor simplification
I think in this case, having a separate function is confusing.
2013-10-24 22:50:13 +02:00
wm4
4cd143e4d8 m_config: store m_config_options in an array instead of a list
Might reduce memory overhead, and is also less annoying.

Since pointers to m_config_options are kept around, this assumes
they're added only during initialization. Otherwise you'd get
dangling pointers.
2013-10-24 22:50:13 +02:00
wm4
a217c08b17 m_config: refactor initialization, reduce amount of malloc'ed strings
Allocate strings only if needed (when we have to prefix sub-options).
Prepare for storing m_config_options in an array instead of a list.
2013-10-24 22:50:13 +02:00
wm4
cfc72d4fff m_config: slightly simplify dynamic option initialization
We can assume memcpy is enough, because the source should be from
static data. (It wouldn't work if the data could contain pointers
back into itself.)
2013-10-24 22:50:13 +02:00
wm4
8d5f8d5a6b m_config: don't allow aliasing with string options
Minor simplification. String options are now not allowed to use the
same variable/field anymore. (Also affects other "dynamic" options
which require memory allocation.)
2013-10-24 22:50:13 +02:00
wm4
cc235d203d m_config: cosmetics: make code less verbose 2013-10-24 22:50:13 +02:00
wm4
d58d4ec93c audio/out: remove useless info struct and redundant fields 2013-10-23 19:30:02 +02:00
wm4
e60b8f181d audio/filter: split af_format into separate filters, rename af_force
af_format is the old audio conversion filter. It could do all possible
conversions supported by the audio chain. However, ever since the
addition of af_lavrresample, most conversions are done by
libav/swresample, and af_format is used as fallback.

Separate out the fallback cases and remove af_format. af_convert24 does
24 bit <-> 32 bit conversions, while af_convertsignendian does sign and
endian conversions. Maybe the way the conversions are split sounds a bit
odd. But the former changes the size of the audio data, while the latter
is fully in-place, so there's at least different buffer management.

This requires a quite complicated algorithm to make sure all these
"partial" conversion filters can actually get from one format to
another. E.g. s24le->s32be always requires convertsignendian and
convert24, but af.c has no idea what the intermediate format should
be. So I added a graph search (trying every possible format and
filter) to determine required format and filter. When I wrote this,
it seemed this was still better than messing everything into
af_lavrresample, but maybe this is overkill and I'll change my
opinion. For now, it seems nice to get rid of af_format though.

The AC3->IEC61937 conversion isn't supported anymore, but I don't think
this is needed anywhere. Most AOs test all formats explicitly, or use
the AF_FORMAT_IS_IEC61937() macro (which includes AC3).

One positive consequence of this change is that conversions always
include dithering (done by libav/swresample), instead of possibly going
through af_format, which doesn't do anything fancy.

Rename af_force to af_format. It's essentially compatible with command
line uses of af_format. We retain a compatibility alias for af_force.
2013-10-23 10:04:12 +02:00
wm4
da6093a5a1 mplayer: don't call libquvi for local files
This is obviously not needed, and just creates potential for bad
breakages (e.g. what happens if libquvi tries to open a normal filename
as http URL?).

Note that for simplicity, we still pass file:// URIs to quvi, and we
don't exclude other protocol prefixes either. In general, we don't know
what protocols quvi might support, so we don't try to second-guess it.
(Even though in practice, it's probably only "http" and "https".)
2013-10-20 21:33:27 +02:00
wm4
afa9e50587 input: fix --input-ar-rate=0
Crashed, instead of disabling auto-repeat.
2013-10-20 13:55:10 +02:00
wm4
f50b105d06 tl_matroska: fix use-after-free with --cache
If cache was enabled, using ordered chapters could easily crash. The
reason is that enable_cache() reopens the demuxer and closes the old
one. The code after that (reading m->ordered_chapters etc.) then
accessed freed data.

This commit also avoids enabling cache for files which are not used
(which would make opening much slower).
2013-10-19 22:58:02 +02:00
wm4
d2d0bc31bf mp_talloc: simplify a bit
Implement MP_GROW_ARRAY using MP_TARRAY_GROW. MP_GROW_ARRAY is basically
the earlier version of MP_TARRAY_GROW, and had different semantics. When
I added MP_TARRAY_GROW, I didn't dare to change it, but I think all code
that relied on the exact semantics of MP_GROW_ARRAY is gone now, or the
difference doesn't matter anyway. The semantic change is that now
(n+1)*2 elements are preallocated instead of n*2.

Also, implement MP_TARRAY_GROW using MP_RESIZE_ARRAY, which saves 1 line
of code.

In future, these macros should be part of TA.
2013-10-19 21:43:08 +02:00
wm4
e046fa584a mp_msg: remove gettext() support
Was disabled by default, was never used, internal support was
inconsistent and poor, and there has been virtually no interest in
creating translations.

And I don't even think that a terminal program should be translated.
This is something for (hypothetical) GUIs.
2013-10-18 22:38:10 +02:00
wm4
fd0ffa7b40 mplayer: mp_msg replacements
Not 100% complete; not touching the more complicated cases.
2013-10-18 21:59:52 +02:00
ChrisK2
6e34322dec osc: make transparency of background-box configurable
see boxalpha option
2013-10-18 00:33:01 +02:00
wm4
af0306d48d Merge Matroska ordered chapter changes
This adds support for ChapterSegmentEditionUID (pull request #258),
and also fixes issue #278 (pull request #292).

In fact, this is a straight merge of pr/292, which also contains pr/258.
2013-10-17 00:32:14 +02:00
Alessandro Ghedini
de3a979f69 spelling fixes 2013-10-16 12:36:34 +02:00
Ben Boeckel
1b30a0bbf9 matroska: don't add time for chapters without a source 2013-10-15 21:16:05 -04:00
Ben Boeckel
648e8fbeed matroska: log about where missing time comes from 2013-10-15 21:04:16 -04:00
Ben Boeckel
78545fee42 matroska: only error if at least a millisecond is missing 2013-10-15 20:53:10 -04:00
Ben Boeckel
abee328f20 matroska: account for missing information from short sources
If a source is shorter than the requested chapter length, account for
the time missing.
2013-10-15 20:53:10 -04:00
Ben Boeckel
e80fd3f9e1 matroska: modify chapter limits by join_diff
When adding or removing frames to avoid 1-frame seeks on chapter
boundaries, the end of the chapter needs to be pushed or pulled by the
same amount to keep the intended end frame the same.
2013-10-15 20:46:38 -04:00
ChrisK2
71b0c2b88c osc: fix borked options 2013-10-15 22:41:19 +02:00
ChrisK2
a54ca2da31 osc docs: Add documentation for OSC and rename some options
camelCase from some of the option names removed. If you were using those, you'll have to update them in your config.
2013-10-15 22:30:33 +02:00
ChrisK2
97770473d0 osc: reset mouse position when leaving window
and store it freshly on first mouse_move event when entering again
2013-10-15 21:49:06 +02:00