[FFmpeg-cvslog] r11482 - trunk/libavcodec/h264_mp4toannexb_bsf.c

andoma subversion
Wed Jan 9 09:38:28 CET 2008


Author: andoma
Date: Wed Jan  9 09:38:28 2008
New Revision: 11482

Log:
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.



Modified:
   trunk/libavcodec/h264_mp4toannexb_bsf.c

Modified: trunk/libavcodec/h264_mp4toannexb_bsf.c
==============================================================================
--- trunk/libavcodec/h264_mp4toannexb_bsf.c	(original)
+++ trunk/libavcodec/h264_mp4toannexb_bsf.c	Wed Jan  9 09:38:28 2008
@@ -41,8 +41,8 @@ static void alloc_and_copy(uint8_t **pou
     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;
     }
 }
 




More information about the ffmpeg-cvslog mailing list