[Live-devel] [PATCH 1/2] H264or5VideoStreamFramer: fix parsing logic

Stas Tsymbalov tsymbalov at trueconf.ru
Tue May 19 08:08:05 PDT 2015


Right now H264or5VideoStreamParser can return 0 from parse() without
requesting more data from input source which leads to frame
delivery process becomes stalled (as MPEGVideoStreamFramer::continueReadProcessing()
does not call afterGetting() in this case either).
This can happen for several reasons:
  1. Simply if input stream contains 2 or more consecutive start codes (AFAIK this
should never happen in valid byte stream, but parser should not break if
it happens).
  2. As a result of following sequence of events:
    a. Parser reads all bytes prior to next start code, then gets
interrupted because there is no more data available.
    b. stopGettingFrames() gets called on framer and next frame is requested
via getNextFrame(). This discards parsed data from previous frame and
parser now assumes that it is reading new frame and thus already read
start code.
    c. Parser receives next bytes from input source which are the start
code.

This patch moves start code parsing (and discarding) to the beginning of
parsing current frame. Additionaly multiple start codes in row are
treated like one.
---
 liveMedia/H264or5VideoStreamFramer.cpp | 36 ++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)



-- 
Stas Tsymbalov
TrueConf LLC
http://trueconf.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-H264or5VideoStreamFramer-fix-parsing-logic.patch
Type: text/x-patch
Size: 2667 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20150519/b1289384/attachment.bin>


More information about the live-devel mailing list