summaryrefslogtreecommitdiffstats
path: root/demux/demux_timeline.c
Commit message (Collapse)AuthorAgeFilesLines
* demux_timeline: request subtitle prefetching on crossing segmentswm42016-03-251-1/+1
| | | | | | | | | | | SEEK_HR is interpreted by demux_mkv.c, and enables subtitle preroll by prefetching additional subtitle pakcets which might overlap with the seek destination. This should make the case work when segment boundaries fall into the middle of subtitle events. This still usually leaves a flicker of at least 1 frame on start, because dec_sub.c does not ensure that enough subtitles are read before rendering after a segment switch. (Probably a WONTFIX.)
* demux_timeline: skip decoder reinit when seeking to same segmentwm42016-03-171-5/+3
| | | | | "Normal" seeks, which don't actually switch the segment, do not need to reinit the decoders.
* demux_timeline: set correct seekable flagswm42016-03-031-1/+1
| | | | | | Tricky misleading crap. Fixes #2898.
* demux: remove relative seekingwm42016-02-281-15/+3
| | | | | | | | | | | | | | | | | | | Ever since a change in mplayer2 or so, relative seeks were translated to absolute seeks before sending them to the demuxer in most cases. The only exception in current mpv is DVD seeking. Remove the SEEK_ABSOLUTE flag; it's not the implied default. SEEK_FACTOR is kept, because it's sometimes slightly useful for seeking in things like transport streams. (And maybe mkv files without duration set?) DVD seeking is terrible because DVD and libdvdnav are terrible, but mostly because libdvdnav is terrible. libdvdnav does not expose seeking with seek tables. (Although I know xbmc/kodi use an undocumented API that is not declared in the headers by dladdr()ing it - I think the function is dvdnav_jump_to_sector_by_time().) With the current mpv policy if not giving a shit about DVD, just revert our half-working seek hacks and always use dvdnav_time_search(). Relative seeking might get stuck sometimes; in this case --hr-seek=always is recommended.
* demux_timeline: slightly improve reported file formatwm42016-02-251-1/+3
| | | | | Report the underlying demuxer's format. Since there can be many demuxers participating, pick the "main" segment.
* demux_timeline: fix nested timelineswm42016-02-201-1/+1
| | | | | You can e.g. reference ordered chapters or other EDL files in EDLs. There were some bugs left which broke this in some cases.
* demux_timeline: cosmetics: move a functionwm42016-02-161-26/+24
| | | | Gets rid of a forward declaration.
* demux_timeline: disable cache for inactive segmentswm42016-02-161-0/+8
| | | | | | | | This is achieved indirectly by deslecting all streams for the non- current segment (and if the segment doesn't share the demuxer with the currently active one). Restores functionality added with commit 46bcdb70.
* Rewrite ordered chapters and timeline stuffwm42016-02-151-0/+392
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.