1
mirror of https://github.com/mpv-player/mpv synced 2024-11-03 03:19:24 +01:00
Commit Graph

36897 Commits

Author SHA1 Message Date
wm4
053c743724 Rename mp_lua.c/h to lua.c/h 2013-12-17 01:15:48 +01:00
wm4
56eafe3344 Rename mp_core.h to core.h
Get rid of the mp_ prefix.
2013-12-17 01:08:53 +01:00
wm4
e449111429 Move mpvcore/player/ to player/ 2013-12-17 00:53:22 +01:00
wm4
7dc7b900c6 Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsg
The tmsg stuff was for the internal gettext() based translation system,
which nobody ever attempted to use and thus was removed. mp_gtext() and
set_osd_tmsg() were also for this.

mp_dbg was once enabled in debug mode only, but since we have log level
for enabling debug messages, it seems utterly useless.
2013-12-16 20:41:08 +01:00
wm4
3e6cd3ef19 input: remove LIRCCD support
This removes support for the "LIRC Client Daemon", which is separate
from LIRC, and hasn't been maintained for 10 years.

See github issue #413.
2013-12-16 20:21:25 +01:00
wm4
9662e3e509 command: mess with previous commit
Nothing actually used the returned length. Since the remaining time can
easily become 0 or negative (e.g. incorrectly estimated file duration),
the time_remaining function still needs 2 return values, though.
2013-12-16 20:14:43 +01:00
Vivek Jain
908dfa7949 command: scale osd’s time remaining by the current speed
Signed-off-by: wm4 <wm4@nowhere>
2013-12-16 20:07:50 +01:00
Alessandro Ghedini
e51808ea22 manpage: fix --vf=expand aspect ratio example 2013-12-16 20:06:45 +01:00
wm4
86bf16f449 input: move multi-command parsing somewhere else
I'm planning to add a mode to pass commands as a pre-split list of
strings, and this will probably be useful to reach this goal.
2013-12-16 20:04:51 +01:00
wm4
bc723f1b68 input: adjust code to make quoted/not quoted cases more unified 2013-12-16 20:03:37 +01:00
wm4
19b506ea65 input: better error reporting for missing commands
Don't print an empty string if the command is missing.
2013-12-16 20:03:00 +01:00
wm4
5173900ed4 input: move some command flags into a bitfield 2013-12-16 20:03:00 +01:00
wm4
b65a6c3cd0 input: remove weird syntax for skipping optional arguments 2013-12-16 20:03:00 +01:00
wm4
fe367272bd manpage: undocument syntax for skipping optional arguments in input commands
"-" could skip optional arguments. I think this was a pretty bad idea,
because it introduced a weird special case.

I'll remove the special syntax, but keep compatibility for the "seek"
and "screenshot" commands.
2013-12-16 20:03:00 +01:00
wm4
e8f21b1f0a input: avoid using wakeup pipe if it's not needed
If input is not waiting for select(), writing to the wakeup pipe is
wasteful, and, if there are many wakeups, might even block the wakeup
threads if the pipe gets full.

However, if it's waiting for select(), the wakup pipe must be used to
unblock the waiting thread. Actually there's a small race condition: we
might determine that the main thread is in select(), and write to the
wakeup pipe (whether we do this while unlocked or locked doesn't really
matter). Then, the main thread might leave select() before reading from
the wakup pipe. This should be harmless, because at worst more wakeups
than needed happen, but never fewer.
2013-12-16 20:03:00 +01:00
wm4
048bb2464d mp_msg: define a bunch of convenience macros
In order to use bare mp_log contexts, I find myself creating dummy
structs (with a single "log" field) to use the MP_ERR() etc. macros,
which hardcode the idiom that a context struct has a log field. On the
other hand, just using mp_msg_log() is too much typing (and I want to
rename it to mp_msg() when the transition is done), so it seems nice to
have message printing macros that use mp_log directly.
2013-12-16 20:02:59 +01:00
wm4
cd064c679c input: don't quit with exit status 1 when receiving SIGTERM
Instead, do whatever the normal "quit" command does, which currently
is returning a status of 0.
2013-12-15 18:14:15 +01:00
wm4
ff85afa537 player: don't temporarily disable terminal handling when reloading files
There's no reason why we should do this. For some reason, the existing
code reset terminal handling to default after unloading a file, just to
initialize it again when loading a new file.

Might be related to github issue #412, although I don't think it helps,
since the default SIGTERM handler _should_ kill the mpv process.
(It's still a nice simplification, though.)
2013-12-15 18:06:21 +01:00
wm4
6dcebd9130 osd_libass: update styles when OSD changes PlayRes
The OSD style settings depend on the PlayRes, simply because all style
values are implicitly scaled by the PlayResY in libass. Also, the OSC
changes the PlayResY in certain situations, so something could go wrong.
But not sure if this actually matters in practice.
2013-12-15 17:38:48 +01:00
wm4
78b5324eee osd: use separate ASS_Renderer for each OSD object
This simplifies things, although it is slightly less efficient (probably
uses a bit more memory).

This also happens to fix that the OSC dropped the libass cache on every
frame.
2013-12-15 15:04:49 +01:00
wm4
3194058309 player: don't store subtitle renderer in osd_state
This doesn't have much value. It can't be accessed by anything else than
the actual subtitle renderer (sd_ass.c). sd_ass.c could create the
renderer itself, except that we apparently want to save memory (and some
font loading time) when using ordered chapters or multiple subtitle
tracks.
2013-12-15 13:44:39 +01:00
wm4
4ca740ccf9 dvdnav: fix incorrect clipping of highlights 2013-12-15 10:21:33 +01:00
wm4
50b3cfa221 demux_mkv: don't seek outside of the file when finding segments
The end of the current segment will be the end of the file if there is
no next segment. Normally, this didn't matter much, since UNIX files
allow seeking past the end of the file. But when opening files from
HTTP, this would print confusing error messages. So explicitly check for
EOF before trying to read a segment.
2013-12-14 21:55:03 +01:00
wm4
2f49fbff93 matroska: add --ordered-chapters-files option
This option takes a playlist. The playlist will then be used as list of
potential segment files for use with ordered chapters.
2013-12-14 21:52:37 +01:00
wm4
7f3eda41d9 manpage: mention that the "run" does not wait for the command 2013-12-14 19:56:02 +01:00
wm4
683d7e88e4 Allow some options taking filenames to refer to mpv config dir
Add the mp_get_user_path() function, and make it expand special path
prefixes. Use it for some things in mpv which take filenames
(--input-config, --screenshot-template, opengl icc-profile suboption).

This allows accessing files in the mpv config dir without hardcoding the
config path by prefixing the path with ~~/. Details see manpage
additions.
2013-12-14 19:54:49 +01:00
wm4
dcf9f77c58 dvdnav: select longest title by default
This way we probably do the right thing, and avoid all the menu shit.
2013-12-14 03:00:59 +01:00
wm4
a59ebae2ad vf_dsize: fix bug caused by typo 2013-12-14 01:50:32 +01:00
wm4
9bd7601c6d dvdnav: crappy hack to respect timed still frames
Before this, they were displayed forever. Since some dvd screens seem
not to allow escaping from the still frame using the menu, this could
get you stuck forever.
2013-12-14 01:40:52 +01:00
wm4
653980ac3a dvdnav, tv: force-disable caching
On dvdnav, caching kind of works but not really. (Not our fault, at
least not fully. It's due to libdvdnav being slightly misdesigned; see
previous commit for some explanations.)

The TV code is implemented in the demuxer, and the stream implementation
is just a wrapper, so caching makes no sense here.
2013-12-14 01:21:06 +01:00
wm4
8510ddba4c dvdnav: enable caching
No idea why this was disabled. It was in the original MPlayer code,
which doesn't make much sense to me, because using the MPlayer stream
cache seems 100% broken due to design issues.
2013-12-14 01:15:56 +01:00
wm4
6002520906 dvdnav: block when libdvdnav requests draining buffers
Not sure how this should work. Using libdvdnav with a large FIFO doesn't
make sense either: data and control commands use the same stream, so if
you want to send input to libdvdnav, you just have to read from
libdvdnav all the time to get a reaction, which is not compatible with
maintaining a buffer that could remain full for a long time.

I have no idea either whether this improves or worsens anything, though
it might be more correct.
2013-12-14 01:11:38 +01:00
wm4
df4d7fd072 stream_dvdnav: drop stream buffers on seek 2013-12-14 01:00:02 +01:00
wm4
fc75506e8b cache: add a way to explicitly resume cache 2013-12-14 00:59:26 +01:00
wm4
1948131a2a cache: try harder on EOF
EOF is a special case. Normally, the reader will block until the cache
thread has new data. Obviously we don't want to do this on EOF, because
we'd potentially block forever. On the other hand, EOF will put the
cache thread into a waiting state, so if EOF recovers, this will happen
at a "later" point. This is bad if there is some kind of external event
that ends the EOF condition. In this case, a steram_read() call would
still return EOF. Make it so that the reader waits at least for one
iteration of the cache trying to rad a new block.

Also adjust some debug messages to not print file positions in hex.
2013-12-14 00:58:06 +01:00
wm4
9a723fc03b stream: don't seek when seeking to the same position
There was already something similar in the code that did the actual
seek,  but I think seeking to the same position could still trigger an
actual seek due to weid interaction with the buffer.
2013-12-14 00:52:39 +01:00
wm4
600bccdf2a stream: add function for dropping the buffer
And use it in demux_lavf.c. It looks like otherwise, some data might be
left over, depending on how the hell av_seek_frame() behaves.
2013-12-14 00:51:00 +01:00
wm4
dd6d204e9e dvdnav: improve a comment 2013-12-13 22:41:21 +01:00
wm4
ad571d629d dvdnav: remove highlights if no PCI available
Not sure if this actually can happen. It doesn't remove the problem that
mpv sometimes shows highlights on nav screens which have no highlight.
2013-12-13 22:38:29 +01:00
wm4
37319ab644 video: change --video-zoom behavior
Use the scaled video size (i.e. as shown on the window) as reference for
zoom. This is the easiest way to fix different width/height scale
factors  as they happen when zooming video with a pixel aspect ratio
other than 1:1.

Also fix the unscaled mode, so that it 1. doesn't scale even with
--video-zoom, and 2. doesn't scale by small amounts when the video is
cropped by making the window smaller than the video.
2013-12-13 22:25:38 +01:00
wm4
ebf6d0004b dvb: prevent seek when reopening the demuxer
Since dvb input is not seekable anyway, this would probably just flush
the stream buffer, but at least it'll avoid a bogus message about
seeking errors.
2013-12-13 00:31:28 +01:00
Nikoli
ce8fe6d815 build: dvdnav needs dvdread 2013-12-13 00:19:52 +01:00
wm4
b0bd93cbc1 dvdnav: support mouse interaction 2013-12-13 00:19:17 +01:00
wm4
88432b817d dec_video: fix handling of timestamp resets
This code tried to pass a still monotonic (even if not strictly
monotonic) PTS to the player, but as a result it remained stuck on
the PTS before a reset (since the PTS was lower).
2013-12-12 23:46:27 +01:00
wm4
e66e16e691 demux_lavf: fix timebase confusion
This set last_pts to bogus values, which is used for relative seeks.
The player usually uses absolute seeks, so this didn't matter much.
2013-12-12 23:43:34 +01:00
wm4
49f9291164 demux: revert accidentally included change from previous commit
Oops.
2013-12-12 01:53:37 +01:00
wm4
0530447417 Add prelimimary (basic, possibly broken) dvdnav support
This readds a more or less completely new dvdnav implementation, though
it's based on the code from before commit 41fbcee. Note that this is
rather basic, and might be broken or not quite usable in many cases.

Most importantly, navigation highlights are not correctly implemented.
This would require changes in the FFmpeg dvdsub decoder (to apply a
different internal CLUT), so supporting it is not really possible right
now. And in fact, I don't think I ever want to support it, because it's
a very small gain for a lot of work. Instead, mpv will display fake
highlights, which are an approximate bounding box around the real
highlights.

Some things like mouse input or switching audio/subtitles stream using
the dvdnav VM are not supported.

Might be quite fragile on transitions: if dvdnav initiates a transition,
and doesn't give us enough mpeg data to initialize video playback, the
player will just quit.

This is added only because some users seem to want it. I don't intend to
make mpv a good DVD player, so the very basic minimum will have to do.
How about you just convert your DVD to proper video files?
2013-12-12 01:46:45 +01:00
wm4
76ce5434b2 demux_lavf: remove unnecessary seek on initialization
This is not needed, and actually completely incorrect.
2013-12-12 01:40:44 +01:00
wm4
a937e93fd6 input: fix bogus section disabling, add debugging output
The code to remove a section from the active section array wasn't
correct (it should have tried to copy the elements in reverse), so just
replace it with a macro that does the intended thing.

Add some debug output to print the section stack.
2013-12-12 01:25:21 +01:00
wm4
fcfd044090 sd_lavc: factor out bitmap positioning code 2013-12-12 01:25:21 +01:00