Browse Source

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
tags/v0.5
Andreas Öman 18 years ago
parent
commit
48aecf5a7d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/h264_mp4toannexb_bsf.c

+ 2
- 2
libavcodec/h264_mp4toannexb_bsf.c View File

@@ -41,8 +41,8 @@ static void alloc_and_copy(uint8_t **poutbuf, int *poutbuf_size,
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;
}
}



Loading…
Cancel
Save