]> git.sesse.net Git - vlc/commit
avformat mux: Mark keyframe blocks as such.
authorSteinar H. Gunderson <steinar+vlc@gunderson.no>
Fri, 16 Aug 2013 14:42:39 +0000 (16:42 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 5 Sep 2013 14:25:35 +0000 (16:25 +0200)
commitafac3fecfedf8b6979c2b74e6c7f8b3121db3588
treead9279f9f0b72ad9204dfbeb9d8a93593736c5da
parent9b554a69b02c4c3957f4306a91d787c9d7e86c8a
avformat mux: Mark keyframe blocks as such.

Some browsers, such as Firefox, are very picky about WebM streams needing to
start with a keyframe. To be able to handle this correctly when streaming,
the avformat mux needs to mark keyframe-containing blocks (or clusters, in
Matroska terminology) as such even after they have been muxed. The next patch
in the series will make httpd actually care about this flag.

Unfortunately, as avformat does not actually propagate this status, we need
to use some heuristics to figure out which blocks contain keyframes. The natural
thing to do would be to say that when we write a keyframe, the block that comes
back has to be a keyframe block, but the WebM/Matroska muxer thwarts this by
having its own internal buffering of clusters, flushing the _previous_ cluster
when we send it a keyframe. Thus, we need to explicitly send a flush (a NULL
packet) before the one that comes back when we mux a keyframe.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/demux/avformat/mux.c