mpv/sub
wm4 0af5335383 Rewrite ordered chapters and timeline stuff
This uses a different method to piece segments together. The old
approach basically changes to a new file (with a new start offset) any
time a segment ends. This meant waiting for audio/video end on segment
end, and then changing to the new segment all at once. It had a very
weird impact on the playback core, and some things (like truly gapless
segment transitions, or frame backstepping) just didn't work.

The new approach adds the demux_timeline pseudo-demuxer, which presents
an uniform packet stream from the many segments. This is pretty similar
to how ordered chapters are implemented everywhere else. It also reminds
of the FFmpeg concat pseudo-demuxer.

The "pure" version of this approach doesn't work though. Segments can
actually have different codec configurations (different extradata), and
subtitles are most likely broken too. (Subtitles have multiple corner
cases which break the pure stream-concatenation approach completely.)

To counter this, we do two things:
- Reinit the decoder with each segment. We go as far as allowing
  concatenating files with completely different codecs for the sake
  of EDL (which also uses the timeline infrastructure). A "lighter"
  approach would try to make use of decoder mechanism to update e.g.
  the extradata, but that seems fragile.
- Clip decoded data to segment boundaries. This is equivalent to
  normal playback core mechanisms like hr-seek, but now the playback
  core doesn't need to care about these things.

These two mechanisms are equivalent to what happened in the old
implementation, except they don't happen in the playback core anymore.
In other words, the playback core is completely relieved from timeline
implementation details. (Which honestly is exactly what I'm trying to
do here. I don't think ordered chapter behavior deserves improvement,
even if it's bad - but I want to get it out from the playback core.)

There is code duplication between audio and video decoder common code.
This is awful and could be shareable - but this will happen later.

Note that the audio path has some code to clip audio frames for the
purpose of codec preroll/gapless handling, but it's not shared as
sharing it would cause more pain than it would help.
2016-02-15 21:04:07 +01:00
..
ass_mp.c ass_mp: add mp_ass_flush_old_events() 2016-01-18 12:12:34 -08:00
ass_mp.h ass_mp: add mp_ass_flush_old_events() 2016-01-18 12:12:34 -08:00
dec_sub.c Rewrite ordered chapters and timeline stuff 2016-02-15 21:04:07 +01:00
dec_sub.h sub: change how subtitles are read 2015-12-29 01:35:52 +01:00
draw_bmp.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
draw_bmp.h csputils: get rid of mp_csp_details 2015-01-06 16:50:58 +01:00
img_convert.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
img_convert.h
lavc_conv.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
osd.c osd: make osd-width/height properties watchable 2016-01-15 22:54:08 +01:00
osd.h osd: use the same ASS_Renderer for OSD text and progbar 2015-11-28 19:24:31 +01:00
osd_dummy.c mpv_talloc.h: rename from talloc.h 2016-01-11 21:05:55 +01:00
osd_font.otf osd+osc: Add left-arrow to osd-font 2014-08-21 18:45:41 +02:00
osd_libass.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
osd_state.h osd: use the same ASS_Renderer for OSD text and progbar 2015-11-28 19:24:31 +01:00
sd.h demux: merge sh_video/sh_audio/sh_sub 2016-01-12 23:48:19 +01:00
sd_ass.c vd_lavc: feed A53_CC side data packets into the demuxer for eia_608 decoding 2016-01-18 12:14:52 -08:00
sd_lavc.c sub: implement "sub-seek 0" 2016-02-04 22:48:13 +01:00