Commit Graph

824 Commits

Author SHA1 Message Date
wm4 5655038a95 command: if playback position is unknown, make percent-pos unavailable
Before that, it just returned -1.

The print case is inconsistent with that, but I'll leave it for now,
because it's consistent with status line / show_progress behavior.
2014-01-15 22:25:14 +01:00
wm4 6759941fca player: redo terminal OSD and status line handling
The terminal OSD code includes the handling of the terminal status line,
showing player OSD messages on the terminal, and showing subtitles on
terminal (the latter two only if there is no video window, or if
terminal OSD is forced).

This didn't handle some corner cases correctly. For example, showing an
OSD message on the terminal always cleared the previous line, even if
the line was an important message (or even just the command prompt, if
most other messages were silenced).

Attempt to handle this correctly by keeping track of how many lines the
terminal OSD currently consists of. Since there could be race conditions
with other messages being printed, implement this in msg.c. Now msg.c
expects that MSGL_STATUS messages rewrite the status line, so the caller
is forced to use a single mp_msg() call to set the status line.

Instead of littering print_status() all over the place, update the
status only once per playloop iteration in update_osd_msg(). In audio-
only mode, the status line might now be a little bit off, but it's
perhaps ok.

Print the status line only if it has changed, or if another message was
printed. This might help with extremely slow terminals, although in
audio+video mode, it'll still be updated very often (A-V sync display
changes on every frame).

Instead of hardcoding the terminal sequences, use
terminfo/termcap to get the sequences. Remove the --term-osd-esc option,
which allowed to override the hardcoded escapes - it's useless now.

The fallback for terminals with no escape sequences for moving the
cursor and clearing a line is removed. This somewhat breaks status line
display on these terminals, including the MS Windows console: instead of
querying the terminal size and clearing the line manually by padding the
output with spaces, the line is simply not cleared. I don't expect this
to be a problem on UNIX, and on MS Windows we could emulate escape
sequences. Note that terminal OSD (other than the status line) was
broken anyway on these terminals.

In osd.c, the function get_term_width() is not used anymore, so remove
it. To remind us that the MS Windows console apparently adds a line
break when writint the last column, adjust screen_width in terminal-
win.c accordingly.
2014-01-13 20:08:13 +01:00
wm4 72743ef6fe command: don't access VO for output parameters
Use the video chain for this instead. This is for facilitating coming
changes, which will clean up the vo->aspdat stuff, and this code would
be in the way.
2014-01-09 21:19:19 +01:00
wm4 98ffa7c476 audio: fix previous commit 2014-01-06 18:51:02 +01:00
wm4 936a204e27 sub: fix previous commit
sub_seek and sub_step were broken.
2014-01-06 17:38:10 +01:00
wm4 2123ca52c9 player: print an error message if run command fails
Note that we can't use mp_msg, because it's not async-signal safe (we
might be running other threads while forking, so only functions
specified to be async-signal safe can be called, and this doesn't
include stdio; mp_msg acquires a mutex too).

Also, always print a \n before running the program to flush the status
line. The effect is that a program running successfully as well as the
error message will effectively start on a new line.
2014-01-05 20:11:01 +01:00
wm4 3720b3f17d player: add --secondary-sid for displaying a second subtitle stream
This is relatively hacky, but it's Christmas, so it's ok. This does two
things: 1. allow selecting two subtitle tracks, and 2. include a hack
that renders the second subtitle always as toptitle. See manpage
additions how to use this.
2013-12-24 17:46:14 +01:00
wm4 9292f537d6 player: add infrastructure to select multiple tracks at once
Of course this does not allow decoding multiple tracks at once; it just
adds some minor infrastructure, which could be used to achieve this.
2013-12-24 17:46:08 +01:00
wm4 b796f2bb76 player: redo demuxer stream selection
Use struct track to decide what stream to select.

Add a "selected" field and use that in some places instead of
checking mpctx->current_track.
2013-12-24 17:44:34 +01:00
wm4 ad2199128d path lookup functions: mp_msg conversions
There's a single mp_msg() in path.c, but all path lookup functions seem
to depend on it, so we get a rat-tail of stuff we have to change. This
is probably a good thing though, because we can have the path lookup
functions also access options, so we could allow overriding the default
config path, or ignore the MPV_HOME environment variable, and such
things.

Also take the chance to consistently add talloc_ctx parameters to the
path lookup functions.

Also, this change causes a big mess on configfiles.c. It's the same
issue: everything suddenly needs a (different) context argument. Make it
less wild by providing a mp_load_auto_profiles() function, which
isolates most of it to configfiles.c.
2013-12-21 21:43:17 +01:00
wm4 9149e2af56 playlist_parser: mp_msg conversion 2013-12-21 21:43:16 +01:00
wm4 d8d42b44fc m_option, m_config: mp_msg conversions
Always pass around mp_log contexts in the option parser code. This of
course affects all users of this API as well.

In stream.c, pass a mp_null_log, because we can't do it properly yet.
This will be fixed later.
2013-12-21 21:05:02 +01:00
wm4 a2d144fc8f m_property: mp_msg conversions
Includes some semi-crappy hacks to avoid changing too much code for this
conversion (allowing NULL log argument for m_property_do()).
2013-12-21 21:04:21 +01:00
wm4 5e0c4ec3e8 player: replace some overlooked mp_msgs
There are still some using IDENTIFY, and some without context in
configfiles.c.
2013-12-19 21:31:18 +01:00
wm4 1fe39b75db command: remove radio commands
Remove these because I'm too lazy to convert them to proper
STREAM_CTRLs. Considering that probably nobody uses radio://, caring
about this is a complete waste of time. I will add these commands back
if someone asks for them, but I don't expect this to happen.
2013-12-19 21:25:40 +01:00
wm4 4ed83fe2e5 Remove the _ macro
This was a gettext-style macro to mark strings that should be
translated.
2013-12-18 17:12:07 +01:00
wm4 94369170b8 command: better check whether file duration is available 2013-12-17 13:49:11 +01:00
wm4 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
wm4 eb15151705 Move options/config related files from mpvcore/ to options/
Since m_option.h and options.h are extremely often included, a lot of
files have to be changed.

Moving path.c/h to options/ is a bit questionable, but since this is
mainly about access to config files (which are also handled in
options/), it's probably ok.
2013-12-17 02:07:57 +01:00
wm4 793f85945f Move libquvi stuff to stream/resolve/ 2013-12-17 01:40:26 +01:00
wm4 8d5214de0a Move mpvcore/input/ to input/ 2013-12-17 01:23:09 +01:00
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