diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-06-14 18:20:14 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-06-15 19:27:20 +0200 |
commit | 76ad8a568f98483c225d59a9f985dc6d054b6b19 (patch) | |
tree | 4b3cdebd240192e7bbc20f910cf380387057b01b | |
parent | f91906973c62459f31beb5683a8e2105758af0bb (diff) | |
download | ffmpeg-76ad8a568f98483c225d59a9f985dc6d054b6b19.tar.gz |
avformat/movenc: fix remuxing eia-608 into mov from other containers
-rw-r--r-- | libavformat/movenc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 5d8dc4fd5d..520aaafb74 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -5582,6 +5582,22 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) goto end; avio_write(pb, pkt->data, size); #endif + } else if (par->codec_id == AV_CODEC_ID_EIA_608) { + size = 8; + + for (int i = 0; i < pkt->size; i += 3) { + if (pkt->data[i] == 0xFC) { + size += 2; + } + } + avio_wb32(pb, size); + ffio_wfourcc(pb, "cdat"); + for (int i = 0; i < pkt->size; i += 3) { + if (pkt->data[i] == 0xFC) { + avio_w8(pb, pkt->data[i + 1]); + avio_w8(pb, pkt->data[i + 2]); + } + } } else { if (trk->cenc.aes_ctr) { if (par->codec_id == AV_CODEC_ID_H264 && par->extradata_size > 4) { |