]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavcodec/h264_mp4toannexb_bsf.c
frsh: Export information about the last RTP contract and VRES
[frescor/ffmpeg.git] / libavcodec / h264_mp4toannexb_bsf.c
index a4cbf873104bf499af96f248000af4136f2d37fa..936418a8a02ae6483e9203c73c19dd22ae359e70 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright (c) 2007 Benoit Fouet <benoit.fouet@purplelabs.com>
+ * H.264 MP4 to Annex B byte stream format filter
+ * Copyright (c) 2007 Benoit Fouet <benoit.fouet@free.fr>
  *
  * This file is part of FFmpeg.
  *
@@ -18,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 
 typedef struct H264BSFContext {
@@ -41,8 +43,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;
     }
 }