options: fix --wid

A recent change accidentally set the flags options to -1 (probably
confusing it with the defasult value?), which mistakenly set all flags
and rejected all option values (except 0).
encoding-example-profiles: for Nokia N900, avoid upscaling

This yields generally smaller files, by avoiding upscaling at all times.
This method may or may not be useful for iOS, needs testing there.

Note: this uses three instances of vf_scale:

1. Scale to target dimensions, ONLY if both are <= original video
   dimensions.
2. Failing that, scale to width*<calculated height by display aspect>,
   ONLY if <calculated height by display aspect> <= original video
   height.
3. Failing that, scale to <calculated width by display aspect>*height.
   When the test before failed, we KNOW that <calculated width by
   display aspect> <= original video width.

So basically, only one of the three scalers should ever be active, as
the last two scalers only can ever have an effect if the aspect ratio
mismatches the video.

As for danger of roundoff errors:

If scaler 1 succeeded, we have won. Scalers 2 and 3 will never do
anything, because display resolution == video resolution. Here it is
crucial that no rounding of video size to display size takes place; in
other words, the target display size already MUST be even, which it is
because we pass 2 to the rounding parameter of the dsize filter.

Scaler 2 and 3 are obviously mutually exclusive, as they depend on
opposite aspect ratio conditions.

We later should put this functionality directly into vf_scale...
mp_msg: fix status output disappearing when redirecting INPUT.

Instead, we now check stderr's destination against the foreground tty
for deciding whether we want status output or not.
mp_msg: print MSGL_STATUS to stderr if stderr is redirected

Of course, status output is still hidden when stderr is a tty which is
not the foreground tty.
input/ar: remove unused variable
stream: silence clang empty statement warnings

clang printed warnings like:

stream/stream.c:692:65: warning: if statement has empty body [-Wempty-body]
            GET_UTF16(c, src < end - 1 ? get_le16_inc(&src) : 0,;

This macro expands to "if(cond) ;". Replace it with an empty statement
that doesn't lead to a clang warning.
demux_mf: fix crashes when '*' matches directories

Doing 'mpv mf://*' in a file with directories would crash, because even
though directories are skipped, the corresponding file entry is just
left at NULL, leading to a segfault on access. So explicitly skip NULL
entries.
demux: fix regressions by restricting cover art hack further

The code modified by this commit is supposed to prevent demuxing the
whole file when cover art is present. (The problem with cover art is
that the ffmpeg libavformat API doesn't signal video EOF correctly - so
we try to read more packets to find the next video frame, which results
in demuxing and queuing the whole audio stream.)

This caused regressions for files with extremely high audio offset (see
github issue #46). MY conclusion is that this cover art crap doesn't
work, and this is just another case of completely insane ffmpeg/libav
API.

Disable the hack in all cases, unless a cover art video track is
selected. Maybe I'll handle cover art directly in the frontend later, so
that we don't have to rely on whatever libavformat does.

Unfortunately, this also makes behavior with equally insane mp4 files
with sparse video tracks worse, but this issue takes priority.
input: fix crash due to dangling pointer

Wrong API usage, has been in the code since 2011. Rarely triggered (if
at all in the current setup).
video: deal with 0x0 window size

If this happens, don't set a NaN aspect ratio.
w32_common: reset internal display size to the window size

vo->dwidth/dheight are overwritten by vo.c at this point (which is not
nice, but it's how things are currently).
encoding-examples-profiles: fix N900 profile

In some cases (when using tune=animation as an additional option), the
N900 profile caused use of 6 reference frames, where Level 3.0 only
allows 5 reference frames. This prevented playback on the Nokia N900.
This has been fixed by always specifying refs=5.
sub: print messages before and after font setup

Helps on Windows, where fontconfig may take some time to finish.

Print it with -v only, because that message would be annoying anywhere
else.
Merge branch 'master' into osdbar_experiment
adjust default osdbar vertical align
disable shadow for osd bar

Doesn't render correctly.