changeset 6134:6d0c5a68d559 libavcodec

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.
author andoma
date Wed, 09 Jan 2008 08:38:28 +0000
parents 5c485301f6f3
children 1c67967d893b
files h264_mp4toannexb_bsf.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }
 }