Revision 0a63a676 libavformat/flvenc.c

View differences:

libavformat/flvenc.c
341 341
    }
342 342

  
343 343
    if (enc->codec_id == CODEC_ID_H264) {
344
        /* check if extradata looks like mp4 formated */
345
        if (enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) {
346
            if (ff_avc_parse_nal_units(pkt->data, &pkt->data, &pkt->size) < 0)
347
                return -1;
348
            assert(pkt->size);
349
            size = pkt->size;
350
        }
351 344
        if (!flv->delay && pkt->dts < 0)
352 345
            flv->delay = -pkt->dts;
353 346
    }
......
368 361
        put_byte(pb,1); // AVC NALU
369 362
        put_be24(pb,pkt->pts - pkt->dts);
370 363
    }
364
    if (enc->codec_id == CODEC_ID_H264 &&
365
        /* check if extradata looks like mp4 formated */
366
        enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) {
367
        ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
368
    } else {
371 369
    put_buffer(pb, pkt->data, size);
370
    }
372 371
    put_be32(pb,size+flags_size+11); // previous tag size
373 372
    flv->duration = FFMAX(flv->duration, pkt->pts + flv->delay + pkt->duration);
374 373

  

Also available in: Unified diff