dvd: add an extra chapter at position 0

This way, chapter 0 will always point to the start of the title.

At least this is the intention; it's likely that DVDs as well as
libdvdnav do random things that lead to random results.
dvd: drop last chapter

Apparently, libdvdnav always reports a last chapter that points to the
exact end of the title. This is useless for us.

Again, same possible caveats as with the previous commit.
stream_cdda: don't return number of tracks as number of titles

Apparently, we treat different tracks as titles, so returning the number
of titles (which is user-visible as "disc-titles" property) is
completely misguided.
command, dvd: add property which returns list of DVD titles

This was requested.

It seems libdvdread can't get the duration for titlesets other than the
currently opened title. The data structures contain dangling pointers
for these, and MPlayer works this around by opening every title
separately for the purpose of dumping the title list.
mp_image: check for malloc failure

Or rather, the only reason av_buffer_create() can fail is a malloc
failure.
vd_lavc: fix error handling path

The ctx->pic check must uninitialize the decoder.
vo: add code to redraw as fast as the display allows

This will be useful to implement features like Smooth Motion where the VO
driver needs to be called before every vsync (regardless of the fact that
there is a new image).
vo: add a new function to be called with vsync timing
vo_opengl: add draw_image_timed stub
vo: reject 0 pts in the vsync_timed case

Avoids a whole lot of redraws during inits/uninits.
vo: sleep as much as possible before the vsync

The arbitrary value of 4ms at which we wake is just something that’s
big enough to account for variations of vsync times.

A much nicer solution would include automatically adjust this value so
that’s as late as possible for mpv to not miss the vsync while still
preserving good responsiveness (by sleeping as much as possible). Or
we could integrate APIs like DisplayLink on OS X so that we get waked
just before vsync (DisplayLink would automatically adjust the wake time
if it detects we arrived late for the last vsync).
vo: move frame timing struct in it’s own header

This is needed so that we can pass down the struct to gl_video in later
commits, without coupling it to vo.h directly. gl_video still recursively
includes vo.h but is mostly decoupled from it.
TOOLS/stas-conv: add timed value event type
vo_opengl: initial smoothmotion support

This uses a very simple algorithm that blends the resulting frames. The code
will need changes since the blending must be done in linear light to improve
image quality and color correctness.
vo_opengl: add a smoothmotion threshold

This allows to skip blending if the if there's a frame close enough to the
next vsync. A value of 0.2 will skip blending for frames that are within 20%
time distance of the vsync.
vo_opengl: interpolate frames in linear light