changeset 3394:02efb6e3eefa libavformat

check if extradata comes from mp4 and assume bitsteam is already formated, should fix streamcopy
author bcoudurier
date Thu, 29 May 2008 00:35:23 +0000
parents f95ddc69c48d
children 330712116269
files flvenc.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flvenc.c	Wed May 28 22:26:35 2008 +0000
+++ b/flvenc.c	Thu May 29 00:35:23 2008 +0000
@@ -336,7 +336,9 @@
         put_byte(pb, FLV_TAG_TYPE_AUDIO);
     }
 
-    if (enc->codec_id == CODEC_ID_H264) {
+    if (enc->codec_id == CODEC_ID_H264 &&
+        /* check if extradata looks like mp4 formated */
+        enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) {
         if (ff_avc_parse_nal_units(pkt->data, &pkt->data, &pkt->size) < 0)
             return -1;
         assert(pkt->size);