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

54 Commits

Author SHA1 Message Date
wm4
2b87415f6f player: do initial seek for external tracks only once
Normally, there can be only one demuxer stream active for each demuxer
of an external file, but this assumption will be broken for multiple
subtitles support.
2013-12-24 17:45:06 +01:00
wm4
1d86134ec1 player: slightly simplify seeking in external files
For some reason, this checked whether there are external tracks at all
before doing any seeks. Possibly this was to avoid multiple
get_main_demux_pts() calls, but calling this multiple times shouldn't be
too bad.
2013-12-24 17:45:06 +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
b59f2c99e7 player: fix typo in previous commit
Apparently I pushed too quickly.
2013-12-23 17:33:07 +01:00
wm4
d259d88af8 player: warn if Matroska font attachments have incorrect MIME type
Normally we shouldn't load these files. But for some reason it was added
in commit b784346e some years ago, and disabling this hack would
probably be an inconvenience. So just print a warning.
2013-12-23 17:31:42 +01:00
wm4
88fd763e18 player: simplify mp_load_per_file_config
Get rid of the stupid and error-prone buffer size calculations, use
snprintf instead of strcpy.
2013-12-22 23:25:10 +01:00
wm4
ffcf4ece6e player: move code around
The only thing that used mp_load_per_file_config() was inside
configfiles.c too, so remove the declaration from core.h and move the
function before its use.
2013-12-22 23:25:10 +01:00
wm4
2e1c423dff player: remove code duplication for auto-loaded config profiles
Code for loading "[vo.vdpau]" profiles and similar. The messages printed
on loading change, but other than that, everything should behave about
the same.
2013-12-22 23:25:10 +01:00
wm4
3782fa20ed path: change mp_splitext() semantics
Including the "." in the returned extension was too inconvenient. I
think originally, the semantics were supposed to work like in Python,
but screw this.

Also, return NULL instead of "" on failure (which is what its only user
actually seems to expect).
2013-12-22 23:25:08 +01:00
wm4
e6bea0ec5a Don't include version.h from make options.c
I find this annoying. It's the reason common/version.c exists at all.

options.c did this for the user agent, which contains the version
number. Because not including version.h means you can't build the user
agent and use it in mp_default_opts anymore, do something rather awkward
in main.c to initialize the default user agent.
2013-12-22 14:35:45 +01:00
wm4
245e5b8441 msg: remove global state 2013-12-21 23:11:12 +01:00
wm4
8e75cc3339 player: use separate msg prefix for statusline
So the user can specifically mute or unmute the status line with
--msglevel. Accidentally removed with commit 5e0c4ec3.
2013-12-21 22:13:05 +01:00
wm4
eef36f03ea msg: rename mp_msg_log -> mp_msg
Same for companion functions.
2013-12-21 22:13:04 +01:00
wm4
eba5d025d2 msg: convert defines to enum
Also get rid of MSGL_HINT and the many MSGL_DBG* levels.
2013-12-21 22:13:04 +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
d9b5652cac quvi: mp_msg conversions 2013-12-21 21:43:17 +01:00
wm4
0335011f11 stream: mp_msg conversions
We also drop some slave mode stuff from stream_vcd.
2013-12-21 21:43:16 +01:00
wm4
3dbc9007b0 demux: mp_msg conversions
The TV code pretends to be part of stream/, but it's actually demuxer
code too. The audio_in code is shared between the TV code and
stream_radio.c, so stream_radio.c needs a small hack until stream.c is
converted.
2013-12-21 21:43:16 +01:00
wm4
9149e2af56 playlist_parser: mp_msg conversion 2013-12-21 21:43:16 +01:00
wm4
8cd1b33a22 x11: mp_msg conversion for fstype help output 2013-12-21 21:43:16 +01:00
wm4
9428e05b3f encode_lavc: mp_msg conversions
Miss two mp_msg calls, because these conflict with future commits.
2013-12-21 21:43:16 +01:00
wm4
09e588662e options: some more mp_msg conversions 2013-12-21 21:43:16 +01:00
wm4
d57eaa7e30 av_log: mp_msg conversion
This is pretty nasty, because FFmpeg/Libav is yet another library with a
global message callback. We do something with mutexes trying to get it
done, but of course we can't actually solve this problem. If more than
one library in a process use FFmpeg/Libav, only one of them will get log
messages.
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
ed71606e65 input: rework how input sources are added
Until now, there were two functions to add input sources (stuff like
stdin input, slave mode, lirc, joystick). Unify them to a single
function (mp_input_add_fd()), and make sure the associated callbacks
always have a context parameter.

Change the lirc and joystick code such that they take store their state
in a context struct (probably worthless), and use the new mp_msg
replacements (the point of this refactoring).

Additionally, get rid of the ugly USE_FD0_CMD_SELECT etc. ifdeffery in
the terminal handling code.
2013-12-21 20:50:13 +01:00
wm4
dadf3a9a46 m_config: add custom context to includefunc callback 2013-12-21 20:50:13 +01:00
wm4
3846fc7587 sub/osd: mp_msg conversions 2013-12-21 20:50:13 +01:00
wm4
92f9b51426 find_subfiles: mp_msg conversions 2013-12-21 20:50:13 +01:00
wm4
15ae64d369 player/timeline: mp_msg conversions 2013-12-21 20:50:13 +01:00
wm4
5f0fbacf16 codecs: mp_msg conversion 2013-12-21 20:50:12 +01:00
wm4
1974c9b49d audio: mp_msg conversions 2013-12-21 20:50:12 +01:00
wm4
4abe6b862f mixer: mp_msg conversions 2013-12-21 20:50:11 +01:00
wm4
57359a1d62 lua: minor simplification
Using m_property_do() is more complicated, and will have to be changed
later for mp_msg conversions.
2013-12-21 20:50:11 +01:00
wm4
fb5ee5bfbe player: use MSGL_SMODE for some slave-mode stuff
Replacement for MSGT_IDENTIFY. Can't kill it off completely yet; certain
people would complain to me personally.
2013-12-21 20:50:11 +01:00
wm4
5beedf1967 image_writer: mp_msg conversions
Adds an awkward mp_log argument for error messages.
2013-12-21 20:50:10 +01:00
wm4
2eefa31c88 video/decode: mp_msg conversions
Doesn't cover vdpau/vaapi parts yet, because these are a bit messier.
2013-12-21 20:50:10 +01:00
wm4
426ebbae5f video/filter: mp_msg conversions 2013-12-21 20:50:10 +01:00
wm4
6a8fc3f5e3 msg: change --msglevel, reduce legacy glue
Basically, reimplement --msglevel. Instead of making the new msg code
use the legacy code, make the legacy code use the reimplemented
functionality.

The handling of the deprecated --identify switch changes. It temporarily
stops working; this will be fixed in later commits.

The actual sub-options syntax (like --msglevel-vo=...) goes away, but I
bet nobody knew about this or used this anyway.
2013-12-20 21:07:57 +01:00
wm4
4d4b822171 terminal: abstract terminal color handling
Instead of making msg.c an ifdef hell for unix vs. windows code, move
the code to separate functions defined in terminal-unix.c/terminal-
win.c.

Drop the code that selects random colors for --msgmodule prefixes.
2013-12-20 21:07:57 +01:00
wm4
2f6144c74b osc: use mp.send_commandv
See previous commit. Drop no-osd prefixes, as this is the default for
send_commandv anyway. send_command should probably be renamed later.
2013-12-20 18:02:01 +01:00
wm4
18930ba7dd input, lua: add functions to take pre-split input commands
So you can pass a command as list of strings (each item is an argument),
instead of having to worry about escaping and such.

These functions also take an argument for the default command flags. In
particular, this allows setting saner defaults for commands sent by
program code.

Expose this to Lua as mp.send_commandv command (suggestions for a better
name welcome). The Lua version doesn't allow setting the default command
flags, but it can still use command prefixes. The default flags are
different from input.conf, and disable OSD and property expansion.
2013-12-20 18:01:04 +01:00
wm4
25d4ae74f1 Rename getch2....c/h to terminal....c/h
"getch2" really tells nothing about what the heck this code does. It'd
be even worse when moving the rest of terminal handling code there.
2013-12-19 21:31:27 +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