Commit Graph

35864 Commits

Author SHA1 Message Date
wm4 c8a7140c73 mplayer: start track IDs from 1 rather than 0
Completely pointless, but makes ChrisK happy for some reason.

Track ID 0 is now rejected by the option parser itself.
2013-08-21 18:32:42 +02:00
Cheng Sun 92658864ae manpage: fix (again) incorrect ao_alsa example
One example in ao.rst used the old syntax with misspelling of "no-block".
2013-08-20 23:15:06 +01:00
wm4 e49abd2fa2 command: simplify video brightness/gamma/etc. handling a bit
We don't need to store the offsets of the options corresponding to the
properties, because the option-property bridge knows about this already.

The check against 1000 was for the case if e.g. the --brightness option
is not used. Always overwrite the option value instead, both when
querying and setting the property. (This is needed to make the settings
persistent even if vf_eq is used and the video chain is reinitialized.)

This commit assumes that VFCTRL_SET_EQUALIZER is always paired with
VFCTRL_GET_EQUALIZER (likewise for VOCTRL), which is the case.
2013-08-20 16:23:44 +02:00
wm4 d69b39512d vf_eq: fix behavior when changing parameters
Using -vf eq and changing brightness, contrast, etc. using key bindings
with e.g. "add brightness 1" didn't work well: with step width 1, the
property gets easily "stuck". This is a rounding problem: e.g. setting
gamma to 3 would actually make it report that gamma is set to 2, so
the "add" command will obviously never reach 3 with a step width of 1.
Fix this by storing the parameters as integers.

This was broken in cac7702. This commit effectively changed these
properties to use the value as reported by vf_eq, instead of the
previously set value for the "add" command. This was more robust,
but not very correct either, so we keep the new behavior and make
vf_eq report its parameters more accurately.
2013-08-20 16:11:07 +02:00
wm4 f05206f899 m_option: make "add speed 0.1" command work
Was broken since the speed property was switched from float to double.
2013-08-19 22:32:25 +02:00
wm4 fb022db423 mp_core: declare seek_type enum outside of nested struct
cosmetic change. See previous commit.
2013-08-19 22:32:25 +02:00
Alexander Preisinger 7cec294d08 wayland: separate shm and cursor context
The display, window, keyboard and cursor structures are now cleanly and
logically separated. Also could prevent a future bug where no shm format is set
when the cursor image is loaded (Never happened until now).
2013-08-19 14:12:39 +02:00
wm4 c5e66dde33 m_option: rename struct member named "new"
Cosmetic change to allow C++ code to include this header.

See github issue #195.
2013-08-19 13:03:08 +02:00
wm4 216e8320b0 video: make it possible to scale/pan the video by arbitrary amounts
Add --video-align-x/y, --video-pan-x/y, --video-scale options and
properties. See the additions to the manpage for description and
semantics.

These transformations are intentionally done on top of panscan. Unlike
the (now removed) --panscanrange option, this doesn't affect the default
panscan behavior. (Although panscan itself becomes kind of useless if
the new options are used.)
2013-08-19 13:03:08 +02:00
wm4 67704e2977 options: remove --panscanrange option
This option allowed you to extend the range of the panscan controls, so
that you could essentially use it to scale the video. This will be
replaced by a separate option to set the zoom factor directly.
2013-08-19 12:55:53 +02:00
wm4 4579cce768 mplayer: reshuffle on every loop if --loop and --shuffle are used
See github issue #194.

Unfortunately, this breaks the property that going back in the playlist
always works as expected. This changes, because the playlist_prev
command will work on the reshuffled playlist, instead of loading the
previously played files in order. If this ever becomes an issue, I
might revert this commit.
2013-08-19 01:05:49 +02:00
wm4 2508f38a92 vaapi: use highest available profile, instead of mapping it exactly
Now the code does the same as the original MPlayer VAAPI patch, instead
of trying to map the profiles exactly.

See previous commit for justification and discussion.
2013-08-19 01:05:48 +02:00
wm4 adfb71b79e vdpau: don't try to match codec profiles
Instead, do what MPlayer did all these years. It worked for them, so
there's probably no reason to change this.

Apparently fixes playback with some files, where the VDPAU decoder does
not formally support a profile, but decoding works with a more powerful
profile anyway.

Though note that MPlayer did this because it couldn't do it in a better
way (no decoder reported profiles available when creating the VDPAU
decoder), so it's not entirely clear whether this is a good idea. An
alterbative implementation might try to map the profiles exactly, and
do some fall backs if the exact profile is not available. But this
hack-solution works too.
2013-08-19 01:05:48 +02:00
wm4 062d39fad2 changes: add some things for completeness 2013-08-19 01:05:37 +02:00
wm4 4b506525da vo_vdpau: add RGB support
Apparently this was dropped some years ago, but judging from MPlayer's
handling of this, the original code wasn't so great anyway. The new
code handling clearing of panscan borders correctly, and integrates
better with the YUV path. (Although the VDPAU API sure makes this
annoying with its separate surface types for RGB.)

Note that we create 5 surfaces for some reason - I don't think this
makes too much sense (because we can't use the deinterlacer with RGB
surfaces), but at least it reduces the amount of differences with
the YUV code path.

Clearing the borders is done by drawing a single black pixel over the
window. This sounds pretty dumb, but it appears to work well, and
there is no other API for that. (One could try to use the video mixer
for this purpose, since it has all kinds of features, including
compositing multiple RGBA surfaces and clearing the window background.
But it would require an invisible dummy video surface to make the
video mixer happy, and that's getting too messy.)
2013-08-18 05:46:02 +02:00
wm4 31ce3fcf9d vo_vdpau: fix screenshots if panscan is used
When panscan was used, i.e. the video is cropped to make the video fill
the screen if video and screen aspects don't match, screenshots
contained only the visible region of the source video, stretched to
original video size.
2013-08-18 05:06:46 +02:00
wm4 8f75588615 vo_vdpau: remove unused variable
It was used to manage video surface in the software decoding path, but
now surface management shares the code with hardware decoding.
2013-08-18 01:48:58 +02:00
wm4 6bbcb861fa mplayer: don't make restored options from quit_watch_later per-file local
Consider:

    mpv file1.mkv file2.mkv

and file1.mkv is restored from an earlier session when quit_watch_later
was used. Then all restored options were reset when file2.mkv is played,
even if the user changed them during playback. This affects for example
the fullscreen setting.

Make it so that after finishing a resumed file, the previously restored
settings are not reset again. (Which means only resuming will forcefully
overwrite the settings.)
2013-08-17 21:56:39 +02:00
Philip Sequeira b018c7d936 command: more intuitive chapter seek behavior
If close to chapter start, skipping back goes to previous chapter (no change).
If more than <threshold> seconds in, skipping back will now go to the beginning
of the current chapter instead.

The threshold is set by the new option --chapter-seek-threshold and defaults to
5 seconds.  A negative value disables the new functionality.
2013-08-17 21:32:52 +02:00
Philip Sequeira 8cebec6262 command: allow seek to "chapter -1"
This will seek to the start of the file regardless of whether the first real
chapter starts there or not.
2013-08-17 21:32:41 +02:00
wm4 ab81af477c vo_vdpau: use color close to black as default colorkey (instead of green)
The VDPAU default colorkey, although it seems to be driver specific, is
usually green. This is a pretty annoying color, and you usually see it
briefly (as flashes) if the VDPAU window resizes.

Change it to some shade of black. The new default color is close to what
MPlayer picks as colorkey (and apparently it worked well for them):

    VdpColor vdp_bg = {0.01, 0.02, 0.03, 0};

Since our OPT_COLOR can set 8 bit colors only, we use '#020507' instead,
which should be the same assuming 8 bit colors.

Obviously, you can't use black, because black is a way too common color,
and would make it too easy to observe the colorkey effect when e.g.
moving a terminal with black background over the video window.
2013-08-17 20:06:21 +02:00
wm4 75298d9f0a vo_vdpau: allow setting colorkey
Formally, this sets the "background color" of the presentation queue.
But in practice, this color is also used as colorkey.

This commit doesn't change the VDPAU default yet.
2013-08-17 20:06:20 +02:00
wm4 76963781df m_option: add missing copy callback for some option types
One reaosn for this is that this broke proper handling of .defval, since
m_option_copy did nothing for these option types.
2013-08-17 19:52:33 +02:00
wm4 c890b8942d m_option: make defval const
There's really no reason why it shouldn't.
2013-08-17 19:50:45 +02:00
wm4 8b245c4d4b sd_lavc_conv: don't check AV_CODEC_PROP_TEXT_SUB flag
Not actually useful. This would break whenever a new text subtitle
format would be added, which requires a binary->text transformation.
(mov_text is one such format; disable it.) In general, we would have
to know which packet formats are binary, which we don't, so the only
reasonable way to handle this is a white list.
2013-08-15 23:40:04 +02:00
wm4 3e6ed76935 sub: don't print detected charset if it's UTF-8
Too noisy. This also fixes that iconv() was called if "utf8" was used
as codepage.
2013-08-15 23:40:04 +02:00
wm4 4246b5fbf0 vdpau_old: add forgotten probe callback
Could make it crash if the VO didn't support vdpau decoding.
2013-08-15 23:40:04 +02:00
wm4 a82be4348e manpage: fix incorrect ao_alsa example, extend changes.rst
One example in ao.rst used the old syntax with mangled device names.
Fix it. Mention some shell related caveats. Explicitly mention the
change of device name syntax in changes.rst, because it seems to be
a common issue.
2013-08-15 23:40:03 +02:00
wm4 f9271c2ca2 sub: make --subcp=enca the default. 2013-08-15 23:40:03 +02:00
wm4 fe3c445112 sub: allow specifying a fallback codepage if input is not UTF-8
Normally, --subcp always forces conversion. This really always forces
conversion, even if the UTF-8 check on the input succeeds.

Extend the --subcp to allow codepages as fallback if UTF-8 doesn't
work. So, for example --subcp=utf8:cp1250 will use UTF-8 if the input
looks like UTF-8, and will fall back to use cp1250 if the UTF-8 check
fails.

I think this should actually be the default, but on the other hand,
this changes the semantics of the option, and a user would actually
expect --subcp to force conversion, rather than silently using UTF-8
if that happens to work.
2013-08-15 23:40:03 +02:00
wm4 00f735d5cb bstr: make UTF-8 check stricter
Don't accept overlong sequences. Don't accept codepoints past the
maximum unicode codepoint. Don't accept the UTF-16 surrogate codepoints.

I'm not sure if there are more codepoints that are defined to be
invalid, but we just want to make libavcodec happy, so this is enough.

(libavcodec's subtitle converter checks for valid UTF-8 and throws up
and dies if it's not - now we want to use bstr_sanitize_utf8_latin1() to
force valid UTF-8, so the strictness of our UTF-8 parser has to match at
least that of the libavcodec's check.)

I'm not sure whether the min test is actually 100% correct.

Note that libavcodec also treats BOM codepoints as invalid. This is
definitely a bug: the BOM is really just "zero-width non-breaking space"
redefined by Microsoft, but it is perfectly valid to appear in the
middle of a string. Official Unicode has merely deprecated the old
usage of the BOM codepoint, and didn't make it illegal. Besides, the
string could be from the start of a file, so even this check doesn't
make sense even with libavcodec's insane logic. We don't copy this bug.
2013-08-15 23:40:03 +02:00
wm4 acb51c9243 sub: if charset detection fails, treat it as broken UTF-8
Broken UTF-8 in this context means we treat it as UTF-8, but we also
interpret broken UTF-8 sequences as Latin1.

Also, run our own UTF-8 check function before the charset detectors.
This prevents from ENCA's UTF-8 check possibly messing up (like
detecting 7-bit clean UTF-8 as ASCII, or other things). It also takes
care of UTF-8 detection if no charset detector (ENCA, libguess) is
compiled in, and it lets us deal better with cut-off UTF-8 sequences.
2013-08-15 23:40:02 +02:00
wm4 380fa71fc7 bstr: add UTF-8 validation and sanitation functions 2013-08-15 23:40:02 +02:00
wm4 04bc16f6ea vdpau: fix compilation on Libav
Libav's <libavcodec/vdpau.h> header uses some libavocdec symbols without
forward-declaring them and without including the headers declaring them.
FFmpeg's header for this is fine.
2013-08-15 23:40:02 +02:00
wm4 006c2f66e1 video/decode: change fix_image callback
This might make it slightly easier when trying to implement surface
read-back for hardware decoding.
2013-08-15 23:40:02 +02:00
wm4 be2f2ff033 vd_lavc: fix comment, document hwdec video frame size trickiness
About this issue, it would be better if the surfaces could be allocated
with the real size, and the vdpau video mixer could be created with that
size as well. That would be a bit hard, because the real surface size
had to be communicated to vdpau. So I'm going with this solution. vaapi
seems to be fine with either surface size, so there's hopefully no
problem.
2013-08-15 23:40:02 +02:00
wm4 0da9638576 video/decode: pass parameters directly to hwdec allocate_image callback
Instead of passing AVFrame. This also moves the mysterious logic about
the size of the allocated image to common code, instead of duplicating
it everywhere.
2013-08-15 23:40:02 +02:00
Stefano Pigozzi 30f2db5930 vo_corevideo: add uyvy422 pixel format support
Looks like the vda_h264_dec in ffmpeg likes to output this format and it
inserted swscale to do pixfmt conversion to yuyv422.
2013-08-15 11:22:40 +02:00
Giuliano Schneider e437ecf729 input: fix build if HAVE_PTHREADS is undefined 2013-08-15 11:22:30 +02:00
wm4 cd85379423 sub: fix accidental subtitle overlaps
The fix_overlaps_and_gaps() function in dec_sub.c fixes small gaps or
overlaps between subtitle events. However, sometimes it could happen
that the corrected subtitle events could overlap by 1ms due to bad
rounding, making libass shift subtitles to reduce collisions. (The
second subtitle will be shown above the previous one, even if both
subtitles are visible only for 1ms.)

sd_ass.c rounds the timestamps when converting to integers for unknown
reasons. I think it would work fine without that rounding, but since
I have no clue why it rounds, and since it could be needed to ensure
correct timestamps with ASS subtitles demuxed from Matroska, I'd rather
not touch it. So the solution is to use already rounded timestamps to
calculate the new subtitle duration in fix_overlaps_and_gaps().

See github issue #182.
2013-08-14 15:23:13 +02:00
wm4 3ffabe26af x11: fix --ontop
Apply it after mapping.
2013-08-14 00:36:33 +02:00
wm4 6704e39fcb vaapi: fix typo 2013-08-14 00:36:33 +02:00
Stefano Pigozzi 68b189351c changes.rst: document some OSX and windows changes 2013-08-13 23:20:27 +02:00
Stefano Pigozzi cd973fd30f input.conf: bind AXIS_(LEFT|RIGHT) to seek 5
Binding them to volume was a bad default, so change it.
2013-08-13 23:07:49 +02:00
Stefano Pigozzi 04cdc205bc cocoa_common: add precise scrolling support
This adds precise scrolling support. I ran some tests and it seems a little
bit smoother and well.. precise. The defaults are rebindable using: AXIS_UP,
AXIS_DOWN, AXIS_LEFT and AXIS_RIGHT.
2013-08-13 23:05:46 +02:00
Stefano Pigozzi 11dad6d44b macosx: remove platform specific input queue
Since last commit the input queue in the core is thread safe, so there is no
need for all this platform specific stuff anymore.
2013-08-13 23:02:43 +02:00
Stefano Pigozzi 36586dd7b7 input: make input queue thread safe
If pthreads are enabled the input queue accesses are regulated by acquiring
a mutex. This is useful for platforms like OS X, where the events are created
in the cocoa thread and added to the queue to then be dequeued in the playloop
thread.
2013-08-13 23:02:16 +02:00
Martin Herkt 87ce0c3b8d mpvcore/options: Update default user agent string
Uh… about time, I guess?
2013-08-13 03:43:22 +02:00
wm4 d5f1b1638c demux: move demux_mf before demux_subreader
demux_subreader is quite aggressive, and sometimes detects random
strings in EXIF as subtitle text.
2013-08-12 20:40:39 +02:00
wm4 b644fe3da6 demux_subreader: report what subtitle format has been found 2013-08-12 20:39:43 +02:00