Revision 0a63a676 libavformat/movenc.c

View differences:

libavformat/movenc.c
1732 1732
        memcpy(trk->vosData, enc->extradata, trk->vosLen);
1733 1733
    }
1734 1734

  
1735
    if (enc->codec_id == CODEC_ID_H264 && trk->vosLen > 0 && *(uint8_t *)trk->vosData != 1) {
1736
        /* from x264 or from bytestream h264 */
1737
        /* nal reformating needed */
1738
        int ret = ff_avc_parse_nal_units(pkt->data, &pkt->data, &pkt->size);
1739
        if (ret < 0)
1740
            return ret;
1741
        assert(pkt->size);
1742
        size = pkt->size;
1743
    } else if ((enc->codec_id == CODEC_ID_DNXHD ||
1735
    if ((enc->codec_id == CODEC_ID_DNXHD ||
1744 1736
                enc->codec_id == CODEC_ID_AC3) && !trk->vosLen) {
1745 1737
        /* copy frame to create needed atoms */
1746 1738
        trk->vosLen = size;
......
1777 1769
    trk->sampleCount += samplesInChunk;
1778 1770
    mov->mdat_size += size;
1779 1771

  
1772
    if (enc->codec_id == CODEC_ID_H264 && trk->vosLen > 0 && *(uint8_t *)trk->vosData != 1) {
1773
        /* from x264 or from bytestream h264 */
1774
        /* nal reformating needed */
1775
        ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
1776
    } else {
1780 1777
    put_buffer(pb, pkt->data, size);
1778
    }
1781 1779

  
1782 1780
    put_flush_packet(pb);
1783 1781
    return 0;

Also available in: Unified diff