1 \documentclass{article}
2 \renewcommand{\c}[1]{\texttt{#1}}
5 There are two sources of video gaps:
8 \item Discontiguous outputs from \c{FFmpegDecoder} --- it makes sense
9 to fix these when the frame after the gap is seen, as that's the
10 first time we know about the gap. For example, it emits frame~1
11 then frame~3; when we see 3 we should emit 2 to fill the gap.
12 \item Periods where there is no video content --- these could be long,
13 so you can't just wait for the frame after the gap.
16 Two solutions suggest themselves for the period of no video content:
19 \item Create `black' \c{Piece}s to act as dummy content and emit black
21 \item Fix it in \c{Player::pass()}.
24 Dummy pieces feels like a nice solution but quite wordy as you need a
25 hierarchy of \c{Piece}s with virtual functions and so on.
27 If we can trust \c{Decoder::position()} we know the earliest time that
28 a decoder will emit data when it is next \c{pass()}ed. If this is
29 more than one frame since the last video frame emitted we know we need
30 to emit a black frame. This much seems straightforward.
32 Things appear to get harder with seeking. There are two paths here:
35 \item Seeking into the middle of some video content.
36 \item Seeking into some empty space.
39 and also differences between accurate and inaccurate seek.
41 Let's take them case-by-case:
44 \item \emph{Accurate seek into content} --- we should not fill
45 anything since the correct data will be generated, in time, by
47 \item \emph{Accurate seek into space} --- we should fill up to the
48 earliest decoder position.
49 \item \emph{Inaccurate seek into content} --- we should not fill
50 anything since \c{pass()} will generate something at some
52 \item \emph{Inaccurate seek into space} --- we should fill up to
53 the earliest decoder position from the seek time.