winlin

fix the bug of h.264 bit stream demux.

... ... @@ -876,6 +876,13 @@ int SrsAvcAacCodec::avc_demux_sps()
// XX 00 00 03 XX, the 03 byte should be drop.
if (nb_rbsp > 2 && rbsp[nb_rbsp - 2] == 0 && rbsp[nb_rbsp - 1] == 0 && rbsp[nb_rbsp] == 3) {
// read 1byte more.
if (stream.empty()) {
break;
}
rbsp[nb_rbsp] = stream.read_1bytes();
nb_rbsp++;
continue;
}
... ...
... ... @@ -73,7 +73,7 @@ int srs_avc_nalu_read_uev(SrsBitStream* stream, int32_t& v)
v = (1 << leadingZeroBits) - 1;
for (int i = 0; i < leadingZeroBits; i++) {
int64_t b = stream->read_bit();
int32_t b = stream->read_bit();
v += b << (leadingZeroBits - 1);
}
... ...