core: don't report byte-based playback position with dvd/bluray

DVD and Bluray uses transport stream formats, which can have timestamp
resets. This change disables the frontend code that tries to deal with
demuxers that can have timestamp resets, which (probably) improves
behavior of the seek bar with DVD/BD by reverting to the old behavior.
core: move demuxer time reporting to demuxer
stream: add start time reporting

Will be needed to override the demuxer's start time reporting. We could
be lazy and special-case it since the result is always 0 for the streams
that care, but doing it properly is better.
stream_bluray: support STREAM_CTRLs for managing timeline

Similar to libbluray.
demux: report stream time info instead of demuxer info if possible

Needed for bluray and dvd. demux_mpg (used for dvd playback) did this
manually for the time length.
demux_lavf: set stream_pts

Might make bluray work better.
demux: use special stream seeking code for stream_bluray too
demux_lavf: fix DEMUXER_CTRL_RESYNC

This used the libavformat current position, instead of the mp stream.
Apparently, libavformat won't update its position by calling the
user's stream callbacks. Consequently, DEMUXER_CTRL_RESYNC would
seek to the current position as assumed by libavformat, instead of the
one by mpv. Since the whole point of DEMUXER_CTRL_RESYNC is to make
seeking the stream without knowledge of libavformat work, this was
exactly the wrong thing to do.

Now DVD playback with libavformat seems to work relatively well.
stream_bluray: reset internal stream position too
demux: use talloc for packets
core: refactor seek_chapter() function

Makes it easier to understand... maybe. It's still pretty strange how
this function may either queue the seek or seek immediately. The way
it actually works doesn't change, queuing the seek is just moved into
the function.

Also add a execute_queued_seek() function, which resets the queue state
correctly.
demux: remove retrieval chapter end time

The frontend doesn't use this.
stream: report chapter times

Note that the cache could make this excessively slow, because the
frontend asks for chapter times very often (e.g. all the time when the
OSD bar is visible). Possibly the chapters should be cached instead,
but then we'd need to detect when the chapters change.

As of now stream_dvd uses some sort of quadratic algorithm to get the
time for a chapter, but hopefully this doesn't matter.
demux: never use STREAM_CTRL_SEEK_TO_CHAPTER

This is an experiment to see whether time-based seeking is not enough
for chapter seeks.

Actually, this works much better for DVD seeking for reasons I don't
understand. Before this commit, it complained about decreasing PTS when
doing chapter seeks with DVD and demux_lavf. This suggests that the
state wasn't really reset correctly, although I couldn't find any
obvious bugs when checking the code. These warnings are gone with this
commit.

Chapter seeking behave better too, because the frontend doesn't take a
separate path and uses last_chapter_seek correctly.
demux: use double type for chapter times