1
mirror of https://github.com/mpv-player/mpv synced 2024-07-31 16:29:58 +02:00
Commit Graph

42739 Commits

Author SHA1 Message Date
wm4
49690dd54b manpage: update win32 config path
Well, this probably depends on the exact Windows version.

Fixes #2611.
2016-01-14 10:34:48 +01:00
wm4
c9204fe3a5 video: fix interactively changing aspect ratio
The aspect ratio calculations are cached (mainly so that aspect ratio
related messages are not logged on every frame). The cache is not clared
anymore when video filters are reconfigured, but changing the
video-aspect-ratio property relied on it. Make it explicit.

Fixes #2714.
2016-01-14 09:46:11 +01:00
Oliver Freyermuth
24e7fac50b man: options: Clarify expected behaviour with --dvbin-full-transponder.
Since the streams are chosen from the full TS by the player frontend,
one should not expect that the program which is shown matches the chosen
channel which was used for tuning to the frequency.
Also, reformulate slightly to simplify reading.
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
554c65e466 player: prefer "service_name" as media title.
If it is defined, which it rarely is (e.g. mpegts streams)
this is the preferred title information.
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
8128b7c8e2 options: add "service_name" as display tag.
This is labeled as "name of the service in broadcasting (channel name)"
and exported as a generic tag by avformat-demuxers, notably lavf
when handling mpegts-streams from DVB.
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
0c9b655477 demux_lavf: update metadata with information from AV_PROGRAM on switch.
Need to trigger demux_changed() manually since metadata
of tracks and streams is not changed, but demuxer-metadata
is still changed on program switch.
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
9fb949b49a man: options: hint to cycling of program property.
Very helpful to switch between the different programs
on a transponder in full-transponder-mode for DVB.
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
909b8f89d8 man: input: document new DVB bindings and properties.
There is now H and K for DVB-channel switching,
and the properties dvb-channel (W) and dvb-channel-name (RW).
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
77bac5b550 player: implement SWITCH for dvb-channel-name property, add binding.
The binding is similar to the tv-binding, just with capital letters.
Switching the dvb-channel-name property compared to dvb-channel
means the channel-name is shown on-screen when switching instead of
"dvb-channel (error)" otherwise,
and switching anyways happens without changing the card.
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
64067a9b7c player: remove unused last_dvb_step member.
Channel switching is treated inside the global DVB state
by now. Anyways the last switching direction is not really useful
and of no interest inside the player.
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
62acd315ad player, stream_dvb: implement dvb-channel-name property.
On read, it returns the name of the current DVB program,
on write, it triggers a channel-switch to the program
if it is found in the channel list of the currently active card.
Compared to the dvb-channel property which already exists
and is a pair of integers (card + channel number) this has the limitation
of not switching the card, but is probably of much more common use.
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
c55b242b4e stream_dvb: global protection mutex and usage bit for global_dvb_state.
The mutex is used in dvbin_open and dvbin_close only since these are
the only entry / exit points to the stream.
When opening, it is first checked (mutexed) whether the state already exists
and is in use, then a STREAM_ERROR is returned,
since there may be only one stream_dvb active at a time.
State-creation itself is also protected by mutex.
In dvbin_close, the usage-bit is set to false (mutexed) in case
of channel switch.
In case of stream-teardown, the state is destructed
(also protected by mutex).
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
1e46bda0f8 stream_dvb: implement GET_METADATA and return program name.
Now title will be the current channel name also after channel switch.
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
16723d4bb1 stream_dvb: persist state-information across channel-switches.
The state-structure is kept in a static pointer and reused on
recreation of the stream.
To not leak the state and the FDs within upon mpv shutdown,
the state-structure is still destructed gracefully in dvbin_close(),
unless a channel switch has been initiated directly before.
This fixes channel-switching for DVB which was broken since a609877.
2016-01-14 00:36:53 +01:00
Oliver Freyermuth
4c3f95708f dvb: rename dvb_config_t to dvb_state_t, keep config and state there.
The state-struct now contains everything which can be kept after initial initialization.
This includes the channel-lists, configuration, device-fds and also information like
current channel and current card.
The dvb_priv_t is kept containing the mp-options, a pointer to the state and to the logger.
After this restructuring, the state-struct contains all information which can be persisted
across channel switching.
2016-01-14 00:36:53 +01:00
wm4
9a88b118b4 video: decouple filtering/decoding slightly more
Lots of noise to remove the vfilter/vo fields from dec_video.

From now on, video filtering and output will still be done together,
summarized under struct vo_chain.

There is the question where exactly the vf_chain should go in such a
decoupled architecture. The end goal is being able to place a "complex"
filter between video decoders and output (which will culminate in
natural integration of A->V filters for natural integration of
libavfilter audio visualizations). The vf_chain is still useful for
"final" processing, such as format conversions and deinterlacing. Also,
there's only 1 VO and 1 --vf option. So having 1 vf_chain for a VO seems
ideal, since otherwise there would be no natural way to handle all these
existing options and mechanisms.

There is still some work required to truly decouple decoding.
2016-01-14 00:18:48 +01:00
wm4
785eacf4f3 player: remove stale declaration 2016-01-14 00:18:44 +01:00
wm4
5722f93a74 video: refactor: shuffle code around
struct dec_video should have nothing to do with video filters or
outputs, and this huge chunk of code was somehow stuck directly in
dec_video.c.
2016-01-14 00:18:36 +01:00
wm4
bf13bd0d47 video: refactor: handle video format fixups closer to decoder
Instead of handling this on filter chain reinit, do it directly after
the decoder. This makes the code less entangled. In particular, this
gets rid of the really weird "override params" concept in the video
filter code.

The last_format/fixed_formats have some redundance with decoder_output,
but unfortunately the latter has a slightly different use.
2016-01-14 00:18:31 +01:00
wm4
dd973da108 manpage: mention that image subtitles can not be repositioned etc.
Fixes #2707. (Not entirely following the suggestions there.)
2016-01-12 23:56:04 +01:00
wm4
cbda46370c stream: stream_read_complete() reads from current pos, not 0
(Well, I hope no caller really relied on this anyway.)
2016-01-12 23:50:17 +01:00
wm4
a4cdf1a727 demux_lavf: fix charset conversion with UTF-16 subtitles
UTF-16 subtitles are special in that they are usually read by
libavformat directly, even though they are not in UTF-8. This is
explicitly handled convert_charset() and skips conversion to UTF-8.

There was a bug due to not resetting the file position: if conversion
happens, the actual stream is replaced with a memory stream containing
the converted data, but if conversion is skipped, the original stream
with the wrong file position is kept.

Fix by always opening a memory stream. (We _could_ seek back, but there
is a slight possibility of additional failure due to unseekable
streams.)

Also, don't enter conversion if the subtitle is detected as UTF-8
either.

Fixes #2700.
2016-01-12 23:50:01 +01:00
wm4
e420464ba6 player: simplify backstepping
Basically reimplement it. The old implementation was quite stupid, and
was probably done this way because video filtering and output used to be
way less decoupled. Now we can reimplement it in a very simple way: when
backstepping, seek to current time, but keep the last frame that was
supposed to be discarded when reaching the target time. When the seek
finishes, prepend the saved frame to the video frame queue.

A disadvantage is that the new implementation fails to skip over
timeline boundaries (ordered chapters etc.), but this never worked
properly anyway. It's possible that this will be fixed some time in the
future.
2016-01-12 23:49:00 +01:00
wm4
6fc0fe4426 player: handle hrseek framedrop correctly
This was non-sense and checked the option instead of the actual flag.
Possibly could lead to incorrect hr-seeks.
2016-01-12 23:48:28 +01:00
wm4
671df54e4d demux: merge sh_video/sh_audio/sh_sub
This is mainly a refactor. I'm hoping it will make some things easier
in the future due to cleanly separating codec metadata and stream
metadata.

Also, declare that the "codec" field can not be NULL anymore. demux.c
will set it to "" if it's NULL when added. This gets rid of a corner
case everything had to handle, but which rarely happened.
2016-01-12 23:48:19 +01:00
wm4
81f3b3aafe TOOLS/stats-conv: slightly better color
pyqtgraph's intColor() is less than ideal, especially on white
background. Can't see anything.

Unfortunately the rendering of the legend can't be fixed, because
pyqtgraph is terrible and hardcodes its rendering, including colors.
2016-01-12 15:04:55 +01:00
wm4
796d5266f1 build: fix mpv.conf installation 2016-01-11 22:13:16 +01:00
Stefano Pigozzi
7c804cd796 build: add option to customize config files system path
Some packagers need to install default config files to some path but
automatically load system configuration files from another path.

See #2704
2016-01-11 21:11:10 +01:00
Dmitrij D. Czarkoff
ea442fa047 mpv_talloc.h: rename from talloc.h
This change helps avoiding conflict with talloc.h from libtalloc.
2016-01-11 21:05:55 +01:00
wm4
0915a8497b sub: read subtitles until their timestamps are past video
Change >= to >, because if the timestamps are equal, further subtitle
packets with the same timestamps could be required (e.g. ASS).
2016-01-11 20:37:16 +01:00
wm4
8135838018 player: eliminate demux_get_next_pts()
This slightly changes behavior when seeking with external audio/subtitle
tracks if transport streams and mpeg files are played, as well as
behavior when seeking with such external tracks.

get_main_demux_pts() is evil because it always blocks on the demuxer (if
there isn't already a packet queued). Thus it could lock up the player,
which is a shame because all other possible causes have been removed.

The reduced "precision" when seeking in the ts/mpeg cases (where
SEEK_FACTOR is used, resulting in byte seeks instead of timestamp seeks)
might lead to issues. We should probably drop this heuristic. (It was
introduced because there is no other way to seek in files with PTS
resets with libavformat, but its value is still questionable.)
2016-01-11 20:36:23 +01:00
wm4
f54ae2031e cache: remove useless return value
It was unused, and also returned the wrong value in some cases.
2016-01-11 20:34:34 +01:00
wm4
453ea2cb6c vaapi: replace VA_STR_FOURCC 2016-01-11 20:30:36 +01:00
wm4
9fee7077d4 ao_coreaudio: replace fourcc_repr()
Replace with the more general mp_tag_str().
2016-01-11 20:25:00 +01:00
Dmitrij D. Czarkoff
30fd858e5e etc: rename "example.conf" to "mpv.conf" 2016-01-11 20:23:13 +01:00
wm4
9acea8759b dxva2: log more debug infos
Dump the complete list of decoders and image formats. If it's a decoder
we know, add a stringified name.
2016-01-11 16:24:13 +01:00
wm4
31a4547187 ao_wasapi: move out some utility functions
Note that hresult_to_str() (coming from wasapi_explain_err()) is mostly
wasapi-specific, but since HRESULT error codes are unique, it can be
extended for any other use.
2016-01-11 16:24:13 +01:00
wm4
994459e4ce common: add mp_tag_str() utility function 2016-01-11 16:24:11 +01:00
Dmitrij D. Czarkoff
a1f949d3b8 waf: add "lua51" ("51obsd") to list of possible lua names 2016-01-11 11:52:27 +01:00
Yen Chi Hsuan
459b40cc4b ytdl: Include Referer header as well
Some videos require correct Referer header for downloading, or 403
Forbidden is thrown.
2016-01-10 14:30:31 +01:00
wm4
9628edede0 TOOLS: remove old build system
I'll still use it privately, but nobody else should.
2016-01-10 14:29:06 +01:00
wm4
bd5a02d080 player: detect audio PTS jumps, make video PTS heuristic less aggressive
This is another attempt at making files with sparse video frames work
better.

The problem is that you generally can't know whether a jump in video
timestamps is just a (very) long video frame, or a timestamp reset. Due
to the existence of files with sparse video frames (new frame only every
few seconds or longer), every heuristic will be arbitrary (in general,
at least).

But we can use the fact that if video is continuous, audio should also
be continuous. Audio discontinuities can be easily detected, and if that
happens, reset some of the playback state.

The way the playback state is reset is rather radical (resets decoders
as well), but it's just better not to cause too much obscure stuff to
happen here. If the A/V sync code were to be rewritten, it should
probably strictly use PTS values (not this strange time_frame/delay
stuff), which would make it much easier to detect such situations and
to react to them.
2016-01-09 20:39:28 +01:00
wm4
2a80680d95 Fix build on older libavcodec versions
avcodec_profile_name() was added only a week ago or so.
2016-01-08 17:19:04 +01:00
wm4
8e87ddd7fe manpage: adjust documented screenshot file name
Fixes #2696.
2016-01-08 13:47:12 +01:00
wm4
e4a1086cfb img_format: fix padding calculation with P010
This was broken during refactoring commit e2d90b38 before pushing it.
2016-01-08 12:48:03 +01:00
wm4
12b4f177ec vd_lavc: log codec profile when attempting hardware decoding
Should be useful.
2016-01-08 09:22:25 +01:00
wm4
6a73fcc9ed common: allow "\/" as escape sequence
mp_parse_escape() is used by the JSON parser in json.c, and JSON allows
escaping "/" (solidus).

Although it makes no sense, apparently Javascript traditionally allowed
that as escape sequence for working around issues with embedding
Javascript in HTML. (Or something like this must have been the history
of this issue.) Since it's valid in Javascript, it had to be valid in
JSON as well, and JSON explicitly specifies it as valid escape.

Fixes #2694.
2016-01-08 09:22:25 +01:00
Oliver Freyermuth
2dd8982f73 dvb: cleanup dvb_params struct, remove some unneeded fds
One was just used as an alias, the other one (sec_fd) was not used at
all.

Signed-off-by: wm4 <wm4@nowhere>
2016-01-07 19:20:48 +01:00
wm4
6eccd4a573 img_format: fix compilation on older libavutil releases
AVComponentDescriptor.offset was introduced relatively recently. On
older releases, you have to use AVComponentDescriptor.offset_plus1,
which is now deprecated.

Instead of adding ifdeffery, assume AV_PIX_FMT_NV21 is the only format
for which this applies (and will remain the only case), which is
probably true enough.
2016-01-07 16:54:01 +01:00
wm4
27bc881cd8 vo_opengl: generic semi-planar support
Should take care of the planned FFmpeg AV_PIX_FMT_P010 addition. (This
will eventually be needed when doing HEVC Main 10 decoding with DXVA2
copyback.)
2016-01-07 16:31:52 +01:00