Commit Graph

34613 Commits

Author SHA1 Message Date
wm4 df0312b694 Copyright: cleanup entries for removed code 2013-02-03 16:53:49 +01:00
wm4 5f28c34962 mplayer: make advancing the playlist respect looping
Explicitly advancing the playlist with input commands ("playlist_next")
didn't jump back to the first file, if the current file was the last on
the playlist and looping was enabled.

Fix this and make the behavior with explicit input and playback EOF the
same.

Also add a minor feature: if looping is enabled, and the current file is
the first on the playlist, going back one entry jumps to the last
playlist entry (without changing loop count).

Fixes #22.
2013-02-03 16:52:48 +01:00
wm4 3b37fadc5d demux_lavf: remove weird stream auto-selection
Should be dead code. Stream selection is handled either during
demuxer initialization, or via DEMUXER_CTRL_SWITCH_*.
(If there were actually situations where this code did something, it
was probably broken anyway.)
2013-02-03 16:51:13 +01:00
wm4 d61408f0da demux_lavf: remove "internet radio hack"
It appears this is not needed anymore. ffmpeg can handle "chained" ogg
files fine. These can be created with "cat file1.ogg file2.ogg > chained.ogg",
and are similar (or equal) to some internet radio streams. Apparently
ffmpeg used to add new tracks when crossing boundaries in chained files,
and the hack in demux_lavf.c handled this. At some later point, ffmpeg's
ogg demuxer was improved, and stopped adding new tracks as long as the
codec doesn't change.

Since the hack in demux_lavf.c was hardcoded to Vorbis (i.e. only active
if the new and old track were both Vorbis), it's dead code, and we can
remove it. I couldn't find any stream that triggered this hack, or fails
without it.

Firefox had a similar issue, and its bug tracker makes a good reference:

    https://bugzilla.mozilla.org/show_bug.cgi?id=455165

NOTE: this doesn't update metadata on track changes anymore.
2013-02-03 16:44:41 +01:00
wm4 74b66862d7 mp_common: improve OSD/status time formatting
Allow negative times. Timestamps can be negative, and we actually
display negative time for other reasons too, such as when waiting for
the old audio to drain with gapless audio.)

Avoid overflows with relatively large time values. (We still don't
handle values too large for int64_t.)
2013-02-03 15:41:18 +01:00
Stefano Pigozzi 37c83abe61 cocoa_common: fix `--ontop` behaviour when windowed
Apply setLevel hacks for fullscreen switching with ontop active only in
fullscreen. This keeps the window correctly on top even when losing focus.

Fixes #21

I also reverted NSScreenSaverWindowLevel to NSNormalWindowLevel + 1, so that
the cmd-tab UI is visible
2013-02-03 14:04:13 +01:00
Stefano Pigozzi 530036e5b3 cocoa_common: fix focus with --ontop and space switching
The main problem this commit addresses is when you switched spaced back and
forth with `--ontop` active the video window didn't recive focus again.

Turns out that setting a normal window level just before conceding focus to
other apps / spaces fixes the problem. I think Cocoa is misbehaving here, and
should probably file a radar.

I found 3 related improvements while fixing this:
 *  fullscreen_window_level is a dead body from an older implementation.
 *  Use NSScreenSaverWindowLevel for ontop. This should be a really high window
    level. Definitely higher than NSNormalWindowLevel + 1.
 *  The window level was set correctly only when out of fullscreen.
2013-02-03 11:39:30 +01:00
Stefano Pigozzi ce29e58fe3 cocoa_common: make the resize window menu items use video size
Make the window resizing menu items calculate the new window size based on the
video size and not the current window size.

This only makes a difference when using `--autofit`.
2013-02-03 10:18:55 +01:00
Stefano Pigozzi 68fa3c49db cocoa_events: remove this functionality
This functionality looked smart but created problems with some kinds of
multi touch events. Moreover some events coming from the windows server – like
hovering a corner for window resize – didn't cause the player to wake up
immediately.

The "correct" non hacky way to implement async event polling with cocoa would
be having the vanilla cocoa event loop driving the player and setting up mpv's
terminal FDs as event sources for the cocoa event loop.

Fixes #20
2013-02-02 14:36:05 +01:00
Stefano Pigozzi 6e4a45476f DOCS: update encoding profiles installation instructions
Simply removed the assumption that the user is using `mpv-build`. Now provide 3
lines of shell that can be copy-pasted by the user for instant gratification
(and independent from $PWD).
2013-02-01 22:35:05 +01:00
wm4 4a2e4b684a build: make it work on somewhat older ffmpeg versions
Tested with n0.10.4. All these version checks are rather tricky,
because Libav and FFmpeg change the same thing at slightly different
versions.
2013-01-31 17:42:21 +01:00
wm4 d4246353df stream: set default HTTP user agent to "Mozilla/5.0"
Playing vimeo links using quvi support didn't work, even though clive
could. clive is using quvi and curl to download videos from streaming
sites, so if clive works mpv should always work as well. It didn't, and
it turned out that it was due to the user agent. Change the default
from whatever Lavf sends to what clive and cclive use. This will
probably always work, as c(c)live are by the same author as libquvi,
and there's a high chance it has been tested with all the supported
sites.
2013-01-31 02:01:25 +01:00
wm4 6469322c5a manpage: fixes
Add missing documentation for --quvi-format switch.

Fix description how hw decoding is enabled. The old way currently still
works, but is deprecated.
2013-01-31 01:58:58 +01:00
wm4 fd5637888a screenshot: minor simplification, prefer VF over VO
Remove screenshot_force and associated logic. Always try to use the
screenshot video filter before trying taking screenshots with the VO,
which means that --vf=screenshot now takes the role of --vf=screenshot_force.
(To make this clear, not adding a video filter is still the recommended
way to take screenshots; we just change how VF screenshots are forced.)

Preferring VO over VF and having --vf=screenshot_force used to make
sense when not all VOs supported screenshots, and some VOs had somewhat
broken screenshots (like vo_xv taking screenshots with OSD in it). But
all these issues are fixed now, so just get rid of the cruft.
2013-01-30 23:41:22 +01:00
wm4 cfc3f10bda mplayer: add newline for --print-msg 2013-01-30 01:04:25 +01:00
wm4 0421e17c2b demux_mkv: support more formats with V_UNCOMPRESSED
Select the generic raw video decoder in codecs.cfg ("MPrv" FourCC),
which forces the generic lavc raw video decoder "rawvideo". This means
all FourCCs understood by lavc rawvideo are supported, not just whatever
has codecs.cfg entries.
2013-01-30 00:57:07 +01:00
wm4 237b7491e2 demux: don't use codec_tag for raw PCM formats
In commit 2dd2d9b, raw PCM was switched to always go through ad_lavc,
and mapping codec IDs to mplayer internal codec tags was removed, as it
was not needed anymore. However, some uncompressed audio lavf demuxers
export  their own codec tags, which collide with the existing internal
mplayer codec tags, leading to incorrect raw PCM codec selection based
on the misinterpreted audio tag. Re-add the mapped codec IDs from
2dd2d9b. Map them to an invalid codec tag, so that the generic lavc
decoder is selected (assumes ad_lavc is the decoder for raw PCM).
2013-01-30 00:54:18 +01:00
Stefano Pigozzi a3322cb171 osx_common: cache OSX version number
This commit makes `is_osx_version_at_least` cache the result of reading
`/System/Library/CoreServices/SystemVersion.plist`. Since that is a file
read operation it was bad to use this function frequently (i.e.: when
processing user events).

Remove `is_lion_or_above` (introduced in c9396c0a) as that was a more
specialized wrapper which had the only advantage of adding it's own cache.
2013-01-27 18:38:25 +01:00
wm4 fddba2d529 vo_x11: fix redrawing on expose events
This part wasn't converted when changing to the new OSD redrawing way.
2013-01-27 13:32:39 +01:00
wm4 df80cd379a x11: simplify handling of X Visuals and Colormaps in VOs
Don't force VOs to pick an arbitrary default Visual and Colormap. They
still can override them if needed. This simplifies the X11 VO interface.

Always create a Colormap for simplicity. Using CopyFromParent fails if
the selected visual is not the same of that of the parent window, which
happens for me with vo_opengl.

vo_vdpau and vo_xv explicitly set CWBorderPixel, do that in x11_common
instead (it was already done for native windows, but not for slave mode
windows).

What gl_common did was incorrect in theory: freeing a colormap while a
window uses it will change the colormap of the window to "None", and
the color mapping for such windows is "undefined".
2013-01-27 13:32:27 +01:00
wm4 75164a0e0a x11: fix some obvious video mode switching bugs
The original video mode wasn't reliably restored, so just store the
mode separately.

For some reason, window decorations got into the picture, possibly due
to an incorrect initial window position or something like this.
Normally, the window is positioned and sized such that it covers the
screen entirely, even though the window still has decorations and is
not in fullscreen mode (fullscreen wouldn't be correct, because the
virtual desktop size is not screen size). Hack-fix by forcing window
decorations off when VM-switching.

All in all, VM switching is still buggy and useless.
2013-01-27 13:30:54 +01:00
wm4 0535a14505 x11: reduce VO mode switching code duplication
Some parts for initiating mode switches were duplicated in every VO
supporting X11 (except vo_opengl/gl_common, which didn't support mode
switching). Move this to x11_common.c.

Note that this might be slightly risky: is it really guaranteed that no
VO needed to do "special" setup that depends on X parameters changing
after a mode switch, such as bit depth, visuals etc.? From what I can
see, this shouldn't be the case (X probably can't even change depth on
the fly). Even if this should be a one-way road, VM switching is in
general very useless, and its implementation buggy, so it can just be
removed should unfixable problems arise.
2013-01-27 13:30:54 +01:00
wm4 e4943165c1 x11_common: do not set custom error handler when calling XSelectInput
Do this because we want to remove the global variables required with the
old code. In particular, there doesn't seem any way to set a secure user
data pointer with xlib.

XSelectInput() causes a BadAccess error when some of the requested event
flags are reserved (for exclusive flags like ButtonPress). The custom
error handler caught this and set a global variable, so that the code
could retry the XSelectInput() call without the conflicting flags. Use a
different approach that doesn't need a custom error handler. (Although
we still assume that the error handler doesn't terminate the program.)
2013-01-27 13:30:54 +01:00
wm4 a243acb1de x11: cleanup, refactor
Move things that are used by vo_xv only into vo_xv, same for vo_x11.

Rename some functions exported by x11_common, like vo_init to
vo_x11_common. Make functions not used outsode of x11_common.c private
to that file. Eliminate all global variables defined by x11_common
(except error handler and colormap stuff).

There shouldn't be any functional changes, and only code is moved
around. There are some minor simplifications in the X11 init code, as
we completely remove the ability to initialize X11 and X11+VO
separately (see commit b4d9647 "mplayer: do not create X11 state in player frontend"),
and the respective functions are conflated into vo_x11_init() and
vo_x11_uninit().
2013-01-27 13:30:53 +01:00
Uoti Urpala 9747227e47 windows support: support 64-bit MS Windows in EXTERN_PREFIX definition
The EXTERN_PREFIX definition changed in 94b7db2 needs a separate case
for _WIN64, as MinGW defines both that and _WIN32 but there is no prefix
unlike 32-bit case.

Patch by redxii on http://devel.mplayer2.org/ticket/226
2013-01-27 13:30:53 +01:00
wm4 83c56799cf vf_scale: fix warning 2013-01-27 13:30:53 +01:00
wm4 15ccb8ef1c sws_utils: use libswscale for GBRP output if available
libswscale added support for this recently.
2013-01-27 13:30:53 +01:00
Wessel Dankers d84b572b8c vo_opengl: always dither
Dithering was disabled if the input bit depth was not larger than the
output bit depth of the screen framebuffer. But since scaling, RGB
conversion, and other filters change the number of significant bits
anyway, dithering could still benefit image quality even in these
cases. Always do dithering, unless dithering is completely disabled.

The original intention of this mechanism was not to change the image
needlessly when playing video that matches the native bit depth of the
screen.
2013-01-27 13:27:32 +01:00
wm4 8a7b8c3dd6 stream: fix reconnecting on broken network connections
This didn't work properly for HTTP with libavformat. The builtin HTTP
implementation reconnects automatically on its own, while libavformat
doesn't. Fix this by adding explicit reconnection support to
stream_lavf.c, which simply destroys and recreates the AVIO context.

It mostly works, though sometimes it mysteriously fails, spamming crap
all over the terminal and feeding broken data to the decoders. This is
probably due to itneractions with the cache. Also, reconnecting to
unseekable HTTP streams will make it read the entire stream until the
previous playback position is reached again.

It's not known whether this change makes behavior with "strange"
protocols like RTP better or worse.
2013-01-24 18:56:02 +01:00
wm4 47cec75291 stream: uncrustify stream.c/.h
The formatting almost made me break out in tears.
2013-01-24 17:45:13 +01:00
wm4 42b47624f8 demux_mkv: support V_UNCOMPRESSED video tracks
Tested with a sample generated by: ffmpeg -i in.mkv -an -vcodec rawvideo out.mkv

Also add proper dependencies for the Matroska Perl stuff in Makefile.
2013-01-24 17:45:13 +01:00
wm4 dd96c11d5e stream: implement some HTTP specific options for stream_lavf
The "http:" protocol has been switched to use ffmpeg's HTTP
implementation some time ago. One problem with this was that many HTTP
specific options stopped working, because they were obviously
implemented for the internal HTTP implementation only.

Add the missing things. Note that many options will work for ffmpeg
only, as Libav's HTTP implementation is missing these. They will
silently be ignored on Libav.

Some options we can't fix:
--ipv4-only-proxy, --prefer-ipv4, --prefer-ipv6
    As far as I can see, not even libavformat internals distinguish
    between ipv4 and ipv6.
--user, --passwd
    ffmpeg probably supports specifying these in the URL directly.
2013-01-24 17:45:13 +01:00
wm4 570271c776 cookies: fix crash
This was broken in 3f85094 (probably merge mistake). I guess nobody ever
uses this feature.
2013-01-24 14:32:35 +01:00
wm4 c162b6d64d vd_lavc: add stupid hack to fix decoding of some files with Libav 0.8.x
The decoder returns with AVFrame.format not correctly set for some h264
files (strangely only some). We have to access AVCodecContext.pix_fmt
instead. On newer libavcodec versions, it's the other way around: the
AVCodecContext.pix_fmt may be incorrectly set on pixel format changes,
and you are supposed to use AVFrame.format.

The same problem probably exists on older ffmpeg versions too.
2013-01-24 12:43:36 +01:00
wm4 64b0395e21 sub: add stupid hack for vobsub decoding with Libav
If we detect Libav, always use the old builtin vobsub decoder (in
spudec.c). Note that we do not want to use it for newer ffmpeg, as
spudec.c can't handle the vobsub packets as generated by the .idx
demuxer, and we want to get rid of spudec.c in general anyway.
2013-01-24 12:41:44 +01:00
Uoti Urpala 458c41c5c7 stream_cdda: support latest libcdio version 2013-01-24 12:01:06 +01:00
Rudolf Polzer 8fa59d4655 configure: for now reject the newer libcdio API
A patch supporting the newer API AND the older API is in the works.
2013-01-24 10:45:36 +01:00
Rudolf Polzer 3b22404e07 mp_msg, getch2: unix tty background support
Now, when backgrounded, mpv plays and outputs messages to stdout, but
statusline is not output.

Background<->foreground transitions are detected by signals and polling
the process groups.
2013-01-23 18:05:34 +01:00
wm4 d275e21d6a vo_xv: always try to use native bit depth
Exactly the same issue as with the previous commit. Just like the vdpau
code, this was apparently copy-pasted from the vo_x11 code, even though
it doesn't make much sense.
2013-01-23 16:20:06 +01:00
wm4 d49b58e78f vo_vdpau: always try to native bit depth (makes 30 bit work)
Using vdpau on an X server configured to a bit depth of 30 (10 bit per
component) failed finding a visual. The cause was a hack that tried to
normalize the bit depth to 24 if it was not a known depth. It's unknown
why/if this is needed, but the following things speak against it:
- it prevented unusual bit depths like 30 bit from working
- it wasn't needed with normal bit depth like 24 bit
- it's probably copy-pasted from vo_x11 (where this code possibly makes
  sense, unlike in vo_vdpau)

Just remove this code and look for a visual with native depth.
2013-01-23 15:48:08 +01:00
wm4 2131bdf5b7 options: make --fullscreen not a global option
This was disabled in 4ea60a3 and 70c455a, when all options were still
forced file local, and resetting fullscreen was annoyingly reset when
switching to the next file. mpv keeps all options by default, so this
isn't needed anymore.
2013-01-23 10:57:02 +01:00
wm4 704c0cb2db video: remove -x/-y/-xy options
-x/-y were rather useless and obscure. The only use I can see is
forcing a specific aspect ratio without having to calculate the aspect
ratio float value (although --aspect takes values of the form w:h).
This can be also done with --geometry and --no-keepaspect. There was
also a comment that -x/-y is useful for -vm, although I don't see how
this is useful as it still messes up aspect ratio.

-xy is mostly obsolete. It does two things: a) set the window width to
a pixel value, b) scale the window size by a factor. a) is already done
by --autofit (--autofit=num does exactly the same thing as --xy=num, if
num >= 8). b) is not all that useful, so we just drop that
functionality.
2013-01-23 10:56:47 +01:00
wm4 7885fce7ea video: add --autofit and --autofit-larger options
--autofit=WxH sets the window size to a maximum width and/or height,
without changing the window's aspect ratio.

--autofit-larger=WxH does the same, but only if the video size is
actually larger than the window size that would result when using
the --autofit=WxH option with the same arguments.
2013-01-23 10:56:36 +01:00
wm4 ccaed5eb07 options: allow using % for width and height in --geometry
Now all numbers in the --geometry specification can take percentages.

Rewrite the parsing of --geometry, because adjusting the sscanf() mess
would require adding all the combinations of using and not using %. As
a side effect, using % and pixel values can be freely mixed.

Keep the aspect if only one of width or height is set. This is more
useful in general.

Note: there is one semantic change: --geometry=num used to mean setting
the window X position, but now it means setting the window width.
Apparently this was a mplayer-specific feature (not part of standard X
geometry specifications), and it doesn't look like an overly useful
feature, so we are fine with breaking it.

In general, the new parsing should still adhere to standard X geometry
specification (as used by XParseGeometry()).
2013-01-23 10:56:27 +01:00
wm4 4c56baba40 options: move -geometry parsing to m_option.c
This also means the option is verified on program start, not when the VO
is created. The actual code becomes a bit more complex, because the
screen width/height is not available at program start.

The actual parsing code is still the same, with its unusual sscanf()
usage.
2013-01-23 10:56:11 +01:00
wm4 f2dcdca0c2 video: move handling of -x/-y/-xy options to VO
Now the calculations of the final display size are done after the filter
chain. This makes the difference between display aspect ratio and window
size a bit more clear, especially in the -xy case.

With an empty filter chain, the behavior of the options should be the
same, except that they don't affect vo_image and vo_lavc anymore.
2013-01-23 10:55:00 +01:00
Mad Fish c9396c0aab cocoa_common: improved trackpad scrolling 2013-01-20 23:43:21 +01:00
Mad Fish ec0bd69619 cocoa_common: handle all pending events instead of just one 2013-01-20 16:53:51 +01:00
Mad Fish 5b7327920b ao_coreaudio: use 0 as timeout for CFRunLoopRunInMode
Handle all pending events and exit instead of waiting. When there are lots of
input events (for example, scrolling with trackpad), timeout can add up
to make a huge frame delay. In my tests, if I scroll fast enough, that loop
would never exit.
2013-01-20 16:37:30 +01:00
wm4 326820b0ff video: reset filters on seek
Drop queued frames on seek. Reset the internal state of some filters
that seem to need it as well: at least vf_divtc still produced some
frames using the previous PTS.

This fixes weird behavior with some filters on seeking. In particular,
this could lead to A/V desync or apparent lockups due to the PTS of
filtered frames being too far away from audio PTS.

This commit does only the minimally required work to fix these PTS
related issues. Some filters have state dependent on previously filtered
frames, and these are not automatically reset with this commit (even
vf_divtc and vf_softpulldown reset the PTS info only). Filters that
actually require a full reset can implement VFCTRL_SEEK_RESET.
2013-01-20 03:25:44 +01:00