Fix a bug causing the generated stream to be corrupt if the buffer

contains NAL units previous to the IDR where the SPS/PPS was inserted.

Ok:ed by Benoit on irc.

Originally committed as revision 11482 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Andreas Öman 2008-01-09 08:38:28 +00:00
parent 8b389f15cd
commit 48aecf5a7d

View File

@ -41,8 +41,8 @@ static void alloc_and_copy(uint8_t **poutbuf, int *poutbuf_size,
if (!offset) if (!offset)
AV_WB32(*poutbuf+sps_pps_size, 1); AV_WB32(*poutbuf+sps_pps_size, 1);
else { else {
(*poutbuf+offset)[0] = (*poutbuf+offset)[1] = 0; (*poutbuf+offset+sps_pps_size)[0] = (*poutbuf+offset+sps_pps_size)[1] = 0;
(*poutbuf+offset)[2] = 1; (*poutbuf+offset+sps_pps_size)[2] = 1;
} }
} }