Commit Graph

34912 Commits

Author SHA1 Message Date
wm4 e4837b2d42 core: ignore backstep command if demuxer is not capable
Also, mark demuxer as not capable if DVD playback is done. The problem
with DVD is that playback time (stream_pts) is not reported frame-exact,
and the time is a "guess" at best.
2013-05-05 18:44:24 +02:00
wm4 e5f18eb825 options: correctly handle things like: dvd://1-2/filename
The "/filename" part was silently dropped when a range of titles is
specified.
2013-05-05 18:44:24 +02:00
wm4 6a0421295e demux_lavf: use demuxer ID for transport streams
Might help mapping tracks correctly to stream_bluray, fixing the
issue with the track language not being reported.
2013-05-05 18:44:24 +02:00
wm4 b8fce1217c demux: use demux_lavf instead of demux_mpg for DVD playback
With the commit "demux_lavf: fix DEMUXER_CTRL_RESYNC", DVD playback
seems to work nicely with demux_lavf, and maybe works even better than
with demux_mpg.

The old demuxer can be forced with: --demuxer=mpegps

If no regressions surface, demux_mpg.c will be deleted later.
2013-05-05 18:44:24 +02:00
wm4 18c383f51b demux_lavf: fix DEMUXER_CTRL_RESYNC
This used the libavformat current position, instead of the mp stream
(which reflects current DVD/Bluray read position). This was broken,
because libavformat won't update its position by calling the user's
stream callbacks, negating the whole point of DEMUXER_CTRL_RESYNC.

Now DVD playback with libavformat seems to work relatively well.
2013-05-05 18:44:24 +02:00
wm4 4ed22795bb demux_lavf: set stream_pts
demux_mpg did the same, and doing this in demux_lavf fixes DVD playback
when using this demuxer.

Additionally this might make bluray work better in the future (but for
now, bluray playback doesn't change as it doesn't report stream PTS yet).
2013-05-05 18:44:24 +02:00
wm4 4ba4d6ef3f demux: report stream time info instead of demuxer info if possible
Needed for bluray and dvd. demux_mpg (used for dvd playback) did this
manually for the time length.
2013-05-05 18:44:24 +02:00
wm4 4d14a42997 stream: add start time reporting
Will be needed to override the demuxer's start time reporting. We could
be lazy and special-case it since the result is always 0 for the streams
that care, but doing it properly is better.
2013-05-05 18:44:24 +02:00
wm4 3644433224 core: move demuxer time reporting to demuxer 2013-05-05 18:44:24 +02:00
wm4 acad31c2d3 core: don't report byte-based playback position with dvd
DVD playback uses a demuxer that signals to the frontend that timestamp
resets are possible. This made the frontend calculate the OSD playback
position based on the byte position and the total size of the stream.
This actually broke DVD playback position display. Since DVD reports a
a linear playback position, we don't have to rely on the demuxer
reported position, so disable this functionality in case of DVD
playback. This reverts the OSD behavior with DVD to the old behavior.
2013-05-05 18:44:23 +02:00
wm4 977dc4c63d csputils: use AVCOL_SPC_YCOCG instead of AVCOL_SPC_YCGCO (fixes Libav build)
This one should probably be blamed on ffmpeg. Its headers contain:

     #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG

Uh, ok...
2013-05-05 18:44:23 +02:00
wm4 81a1d07b81 manpage: fix option description 2013-05-05 18:44:21 +02:00
wm4 012d297bb1 video: add --hwdec-codecs option to whitelist codecs for hw decoding 2013-05-04 01:38:27 +02:00
wm4 844249317b vd_lavc: allow explicitly selecting vdpau hw decoders
This allows using the vdpau decoders with -vd without having to use
the -hwdec switch (basically like in mplayer).

Note that this way of selecting the hardware decoder is still
deprecated. libavcodec went away from adding special decoder entries
for hardware decoding, and instead makes use of the "hwaccel"
architecture, where hardware decoders use the same decoder names as
the software decoders. The old vdpau special decoders will probably
be deprecated and removed in the future.
2013-05-04 01:36:15 +02:00
wm4 2cb147a2f4 video: support YCgCo colorspace
YCgCo can be manually selected, but will also be used if the decoder
reports YCgCo. To make things more fun, files are sometimes marked
incorrectly, which will display such broken files incorrectly starting
with this commit.
2013-05-04 01:34:29 +02:00
wm4 872aefaa15 vo_opengl: XYZ input support
Useful for the j2k decoder.

Matrix taken from http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
(XYZ to sRGB, whitepoint D65)

Gamma conversion follows what libswscale does (2.6 in, 2.2 out).

If linear RGB is used internally for scaling, the gamma conversion
will be undone by setting the exponent to 1. Unfortunately, the two
gamma values don't compensate each others exactly (2.2 vs. 1/0.45=2.22...),
so output is a little bit incorrect in sRGB or color-managed mode. But
for now try hard to match libswscale output, which may or may not be
correct.
2013-05-04 01:32:50 +02:00
wm4 16d40828ae video: fix setting XYZ flag
Commit 9e0b68a didn't really do this correctly, failure at basic logic.
2013-05-04 01:32:23 +02:00
wm4 767cbb77ed gl_video: use GL_SRGB only if it's really RGB
Use the proper RGB flag instead of !YUV. Currently, this doesn't change
anything, because only RGB and YUV formats are supported.
2013-05-04 01:31:46 +02:00
wm4 35568f84f3 stream: remove unused new_ds_stream() 2013-05-03 21:08:35 +02:00
wm4 71cc8c1581 vf_rotate: fix for some obscure pixel formats
Repurpose the 3 byte case for any unhandled pixel width. Fixes rotation
with e.g. rgb48. Very inefficient, but works.
2013-05-03 21:08:26 +02:00
Alexander Preisinger f8c13d6b66 wayland: fix wrong poll comment, check for errors
We only print an error message when POLLERR or POLLHUP occurrs, as the
something did go horribly wrong and the server will either deal with it or
crash.

Also add POLLOUT to the events.
2013-05-02 23:24:14 +02:00
Alexander Preisinger 68d4cc4536 wayland: avoid iterating over all outputs
If we use the output itself as user data we don't have to iterate over all
outputs when the handle_mode event comes.
2013-05-02 21:01:19 +02:00
Alexander Preisinger 57e0a84715 wayland: remove unused stuff 2013-05-02 21:01:19 +02:00
Alexander Preisinger c0b8c35e3b wayland: use new function xkb_keymap_from_buffer
Bump xkbcommon version and use the new xkb_keymap_from_buffer. This is more
secure, because the from_string expects a 0 terminated string, but this cannot
be guaranteed with mmap.
2013-05-02 21:01:19 +02:00
wm4 0d1cd116d7 Fix compilation with Libav 2013-05-01 17:02:06 +02:00
wm4 9e0b68a385 video: add XYZ support
Needed for the ffmpeg j2k decoder.
2013-05-01 16:26:45 +02:00
Alexander Preisinger 3899e594ea wayland: remove input modifier variable
This variable was never used anywhere.
2013-05-01 15:46:01 +02:00
Alexander Preisinger db0c3d79f8 wayland: use GetTimerMS for hiding mouse cursor
This commit remove a lot of linux specific code, like epoll. It also reduces
the complexity of the code. Instead of epoll we use poll which makes the
wayland backend more portable to other platforms.
2013-05-01 15:41:33 +02:00
Alexander Preisinger 048c68e5c2 wayland: use mpv internal key auto-repeat handling
This removes a good chunk of code trying to recreate key repeat.
Because the wayland protocol and xkbcommon don't have an interface for
auto-repeating pressed keys.
2013-05-01 13:41:07 +02:00
wm4 d98e61ea43 subreader: fix out of bound write access when parsing .srt
This broke .srt subtitles on gcc-4.8. The breakage was relatively
subtle: it set all hour components to 0, while everything else was
parsed successfully.

But the problem is really that sscanf wrote 1 byte past the sep
variable (or more, for invalid/specially prepared input). The %[..]
format specifier is unbounded. Fix that by letting sscanf drop the
parsed contents with "*", and also make it skip only one input
character by adding "1" (=> "%*1[...").

The out of bound write could easily lead to security issues.

Also, this change makes .srt subtitle parsing slightly more strict.
Strictly speaking this is an unrelated change, but do it anyway. It's
more correct.
2013-04-30 00:14:26 +02:00
wm4 1c96f51e36 demux: simplify stream ID business, fix issue with cover art
The stream ID handling as it was changed in commit 654c34f was still
a little bit insane, and caused a regression with the cover art hack
(the stream set in demux->video->sh was incorrect for demux_lavf).

Simplify by always using stream_index for demux_stream->id, and getting
rid of that tid thing. It turns out that the id for subtitles isn't
special either (maybe demux_ts.c was the only thing left that required
this).
2013-04-29 22:59:15 +02:00
Rudolf Polzer 2d8783075f encoding: fix final audio frame sync
When --ocopyts was used, the final audio frame got improper pts. Fixed
by now using the play() logic to play the final frame too.
2013-04-28 11:39:38 +02:00
Stefano Pigozzi 7a42df8712 cocoa_common: fix window sizing
The code was attempting to get the ceiling of the double. Too bad NSSize has
floats inside of it and the int cast is nowhere to be seen. This caused
rounding errors by one pixel in the window size.
2013-04-28 09:55:06 +02:00
Stefano Pigozzi d500297377 subassconverter: silence clang warning 2013-04-28 09:41:39 +02:00
wm4 4982083b2b osd: convert OSD font to OpenType
The old OSD font was a PostScript Type 1 font. Convert it to OpenType
to work around a fontconfig bug [1]. OpenType is a more modern format,
and the font file is quite a bit smaller, so this is actually a nice
change.

The conversion was done by opening the font with fontforge and saving
it as OpenType (CFF). fontforge showed a warning when doing this:

    The font contains errors.
      Self Intersecting
      Bad Private Dictionary

These seem to be harmless.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=63922
2013-04-27 18:03:19 +02:00
reimar daee1a04e7 stream_bluray: remove the broken -bluray-chapter option
Remove the broken -bluray-chapter option.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36175 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	DOCS/man/en/mplayer.1
	cfg-common.h
2013-04-27 15:28:57 +02:00
reimar 2f004875d3 stream_bluray: fix querying current chapter
br://: Fix querying current chapter.

This also fixes specifying an end chapter via -chapter.
Based on patch by Olivier Rolland [billl users.sourceforge.net]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36173 b3059339-0415-0410-9bf9-f77b7e298cf2
2013-04-27 15:28:34 +02:00
wm4 4a9410880c mplayer: put space before encoding part of status line
Also, the trailing space isn't needed.
2013-04-27 13:45:20 +02:00
Bin Jin eec9b8a012 demux_mkv: fix segfault issue playing back VC1 in a mkv
This bug was introduced in commit 06eee1b.
2013-04-27 13:42:08 +02:00
wm4 bf48f1ecce vd_lavc: fix decoder init failure path
libavcodec decoder initialization failure caused a segfault, because it
wasn't properly reported back in init().

Also remove the return value from init_avctx(), which actually makes
things simpler. Instead, ctx->avctx can be checked to see whether
initialization was ok.
2013-04-27 13:40:55 +02:00
wm4 0cb732f9f1 compat: remove an unused symbol
The compatibility issue actually didn#t get solved, it's just handled
differently in mpv now.
2013-04-26 20:45:39 +02:00
wm4 7bc4b18cee subassconvert: do not escape likely ASS override tags
Usually SubRip files are not expected to contain ASS override tags,
but unfortunately these files seem to become more common. Example from
a real file:

1
00:00:00,800 --> 00:00:15,000
{\an8}本字幕由 {\c&H26F4FF&}ShinY {\c&HFFAE1A&}深影字幕组{\c&HFFFFFF&} 原创翻译制作

subassconvert.c escaped '{', so that libass displayed the above line
literally.

Try to apply a simple heuristic to detect whether '{' is likely to
start an ASS tag: if the string starts with '{\', and there is a
closing '}', assume it's an ASS tag, otherwise escape the '{' properly.
If it's a likely ASS tag, it's passed through to libass.

The end result is that the above script is displayed in color, while at
the same time legitimate uses of '{' and '}' should work fine. We assume
that nobody uses {...} for commenting text in SubRip files. (This kind
of comment is popular and legal in ASS files, though.)
2013-04-26 20:44:18 +02:00
wm4 56efcc7b7f manpage: fix references to --slave 2013-04-26 20:44:18 +02:00
wm4 28a971e26f options: allow using [ ] for quoting in sub-options
This is an attempt to make quoting of sub-option values less awkward,
even if it works only with some shells. This is needed mainly for
vf_lavfi. Also update the vf_lavfi manpage section.
2013-04-26 20:44:18 +02:00
wm4 ca08ce77a9 vf_lavfi: move compat crap to the start of the file 2013-04-26 20:40:27 +02:00
wm4 3ffeeee411 vf_lavfi: silence stupid deprecation warning
libavfilter changed the way a format list is passed to vf_format. Now
you have to separate formats with "|" instead of ":". If you use "|",
it prints an annoying message on every reinit:

    [format @ 0x8bbaaa0]This syntax is deprecated. Use '|' to separate the list items.

...and it will probably stop working without warning at some point in
the future.

We need some very annoying ifdeffery to detect this case, because
libavfilter version numbers are just plain incompatible between Libav
and ffmpeg. There is no other way to detect this.

(Sometimes I wonder whether ffmpeg and especially Libav actually like
causing unnecessary pain for their users, and intentionally break stuff
in the most annoying way possible. Sigh...)
2013-04-26 20:40:24 +02:00
wm4 3765cfcf57 core: simplify handling of --pause
Rename the struct MPOpts "start_pause" field to "pause". Store the user-
pause state in that field, so that both runtime pause toggling and the
--pause switch change the same variable. Simplify the initialization of
pause so that using --pause and changing the file while paused is
exactly the same case (changing the file while paused doesn't unpause,
this has been always this way).

Also make it a bit more consistent. Before, starting with --pause would
reset the pause state for every file, instead of following the usual
semantics for option switches (compare with behavior of --fs).
2013-04-25 20:52:20 +02:00
wm4 e1fccfdcd8 core: don't let cache pause handling and user pausing conflict
The core pauses and unpauses automatically to wait for the network
cache (also known as buffering). This conflicted with user pause
control, and was perceived as if the player was unresponsive and/or
the cache just overturned the user's decisions.

Change it so that the actual pause state and the pause state as
intended by the user never conflict. If the user toggles pause, the
pause state will be in the expected state as soon as the cache is
loaded.
2013-04-25 20:49:23 +02:00
wm4 848542a513 vf_lavfi: recreate filter graph on seek
Resetting the filter graph helps dealing with filters which save state
between frames. This is important especially if they modify frame timing
or emit additional frames.

Unfortunately the libavfilter API doesn't have a way to do this
directly, so we have to use a dirty trick: we recreate the whole graph,
including format negotiation down and filter string parsing. ffplay does
this too. If libavfilter somehow decides to change output format or size
from what the first run in config() returned, mpv will explode. The same
applies to vf_next_query_format() return values (although this could be
mitigated, should it really happen).
2013-04-25 20:38:53 +02:00
wm4 ba5493ff87 core: fix bogus condition that broke backstepping with last commit
This broke all cases where indexing was required, and the current frame
wasn't the first frame in a segment.
2013-04-25 17:52:34 +02:00