vo_gl3: avoid compiler warning with -Wformat-security

There was no real problem with the code, but Ubuntu reportedly forces
the -Werror=format-security compiler switch for all their package
builds. Thus the otherwise harmless warning caused a compilation
failure in their setup.
ad_ffmpeg: remove incorrect request_sample_fmt setting

Commit 91a18f3998 ("audio, libav: support planar Libav audio formats")
added a line setting request_sample_fmt to AV_SAMPLE_FMT_S16P. This
broke FLAC decoding with libavcodec versions since July but without
libavresample (in July the FLAC decoder got the ability to support
either planar or interleaved, depending on request_sample_fmt;
requesting planar without libavresample causes failure). According
to the author this line was left over from testing. Remove.
core: clean up libquvi handling, add media_title property

Clean up handling of libquvi (which is used to resolve stream site
URLs into URLs to the underlying media files that can be played
directly). Before, the stream layer tried to do the URL mapping for
every opened stream. Move the code from open.c to quvi.c, and invoke
it explicitly from mplayer.c for the main playback file only.

This allows easily passing metadata from the quvi context to the
frontend. Expose QUVIPROP_PAGETITLE as new "media_title" property (for
YouTube, this is the video title). If libquvi is not used, this is
equal to the old "filename" property. Add "stream_path" property which
is the real played filename/URL after possible libquvi mapping (in
contrast, the old "path" property is the filename/URL that was
originally given to the player).

Handle a potential reliability issue: check quvi_getprop return
values.

Since there was barely anything left in open.c but the open_stream()
stub, move that to stream.c and delete open.c.
cache: saner automatic cache enable; avoids -playlist crash

Code enabling the cache by default for network streams did that by
modifying the value of the "cache" option. This wasn't sane, as
multiple streams may be created and all share the same options. Change
the code to not modify options but store data in the stream instance
instead.

As a side effect, this commit avoids a crash triggered by commit
5722fa1552 ("core, timeline: cache external ordered chapter files
too"). Some existing code creating streams leaves the option pointer
at NULL. That commit modified the function setting cache size for
network streams to use the option pointer, which led to a crash when
using -playlist with a network URL (would also happen in rare cases
like network --sub). This commit removes the pointer use again,
avoiding the crash; the pointer should be set properly though.
cleanup: fix code calling open_stream() with NULL options

Change all code calling open_stream() to pass a valid option pointer
instead of NULL. Currently this pointer is not strictly needed, so
this should not change behavior (at least in normal cases).
demux_mf: enable --correct-pts mode

Use correct-pts mode for mf:// by default. There should be no reason
not to, while the old mode may fail to display the last frame. Missing
a frame is especially likely to be noticeable with mf.
cocoa_common: create window in the correct screen
vo_gl3: improve Mesa compatibility of context creation

Don't request CONTEXT_FORWARD_COMPATIBLE when creating a GL3 context
on X11. This improves compatibility with some Mesa drivers.

Setting this bit was originally intended to make the code compatible
with newer (future, possibly not yet existing) OpenGL implementations.
These implementations wouldn't have to support deprecated legacy GL
features, which we know that we don't use, and could return a context
with a higher OpenGL version than requested.

In practice, this didn't work out. CONTEXT_FORWARD_COMPATIBLE requires
the driver to explicitly disable deprecated functionality. If it
doesn't do that, it has to reject context creation with that flag set.
And it turns out there are Mesa drivers which suffer from this caveat.
See [1].

This probably also means that a GL application with a fixed set of
required GL features (such as a subset of GL 3.2 core, like vo_gl3.c)
may need to probe several GL versions if drivers really start dropping
legacy GL.

On Windows, CONTEXT_FORWARD_COMPATIBLE is still set. It is not known
if this is ideal, but fortunately there is no Mesa on Windows.

CONTEXT_CORE_PROFILE is still always set. For requested GL versions
lower than 3.2, this flag is ignored. Should we require higher
versions later, we want it to be set, so don't remove it.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=57241
stream_ftp: support longer filenames, general fixes

stream ftp: readline: Fix off-by-one error

Even if max bytes are available read at most max - 1 bytes.

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

stream ftp: readline: Always initialize output parameter buf

Only exception if passed parameter max is less than or equal
to zero. That cannot happen with the current code.

Additionally change readresp function to always copy the first
response line if the parameter rsp is non-NULL. This fixes some
error reporting that used uninitialized stack arrays.

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

stream ftp: readline: Always try to read complete lines

If there is not enough space in the provided line buffer just
skip the remaining bytes until reaching EOL.

Usually we are only interested in the first 5 characters and
for everything else the (on-stack) response buffer should still
be big enough.

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

stream ftp: Revise file descriptor usage

* Set unbound descriptor variables to -1
* Always test >= 0 to see if a variable refers to a valid descriptor

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

stream ftp: Only send QUIT command if connected

Do not attempt to send commands without control connections.

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

stream ftp: Create buffers before opening control connection

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

stream ftp: Allocate command buffer on-heap

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

stream ftp: Increase command buffer size

Allow for more longish file names (be it because of length or more
lengthy characters).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35434 b3059339-0415-0410-9bf9-f77b7e298cf2
subs: remove --utf8 and --unicode, simplify code

Remove the options --utf8 and --unicode which had no effect any more
(what they once did should be doable with --subcp). The only use of
corresponding variables left in code was subreader.c code using
sub_utf8 as a flag indicating whether iconv conversion was active.
Change the code to test the existence of iconv context instead.
subreader: fix some of ASS parser issues

The subreader.c ASS parser (used when playing an external ASS subtitle
file with --no-ass for "plaintext" display) hardcodes dialogue line
syntax instead of correctly reading it from the "Format: " line in the
file, but tried to support a varying amount of fields by guessing
where the text field (which should be last) begins. This guessing code
was buggy in many ways. Remove it and hardcode skipping 9 commas
before the text field, which should work for most files. I don't
consider the --no-ass case important enough to implement correct
parsing now. Also fix the code removing formatting tags, which failed
to remove the second in a pair of two consecutive tags.
Add wayland support

Implements shared routines for initialising wayland and keyboard/pointer input.
Indepentend from the video output.
Add wayland egl support for vo_gl
Enable build for wayland egl

This uses 2 defines
 * CONFIG_WAYLAND
 * CONFIG_GL_WAYLAND

CONFIG_WAYLAND is not used at the moment
wl_egl: remove appendstr
wl: check for PREFFERED mode and remove positions
wl_egl: remove loop around wl_display_roundtrip
wl: simplify configure check
wl_egl: working -fs
wl: set vo_fs to false