# HG changeset patch # User andoma # Date 1199867908 0 # Node ID 6d0c5a68d5590b96b912b2abf64bf6c9bb87eea8 # Parent 5c485301f6f39d582c0656a648b8b767fd172684 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. diff -r 5c485301f6f3 -r 6d0c5a68d559 h264_mp4toannexb_bsf.c --- a/h264_mp4toannexb_bsf.c Tue Jan 08 23:44:48 2008 +0000 +++ b/h264_mp4toannexb_bsf.c Wed Jan 09 08:38:28 2008 +0000 @@ -41,8 +41,8 @@ if (!offset) AV_WB32(*poutbuf+sps_pps_size, 1); else { - (*poutbuf+offset)[0] = (*poutbuf+offset)[1] = 0; - (*poutbuf+offset)[2] = 1; + (*poutbuf+offset+sps_pps_size)[0] = (*poutbuf+offset+sps_pps_size)[1] = 0; + (*poutbuf+offset+sps_pps_size)[2] = 1; } }