diff options
author | Clément Bœsch <u@pkh.me> | 2014-09-14 20:30:27 +0200 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2014-09-30 20:21:14 +0200 |
commit | 55180b3299c61e5e3d16f1e9ea58dba8b787cc8e (patch) | |
tree | 9984561f4546525c823dfad5051c749533aa46a9 /libavformat/matroskaenc.c | |
parent | d5ddcb5f8e7b14974fabd5e95e6420c6e9b12991 (diff) | |
download | ffmpeg-55180b3299c61e5e3d16f1e9ea58dba8b787cc8e.tar.gz |
Kill timed SRT
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r-- | libavformat/matroskaenc.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 3fa4babbdb..4af2d6eb97 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1589,47 +1589,6 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb, } } -static int srt_get_duration(uint8_t **buf) -{ - int i, duration = 0; - - for (i = 0; i < 2 && !duration; i++) { - int s_hour, s_min, s_sec, s_hsec, e_hour, e_min, e_sec, e_hsec; - if (sscanf(*buf, "%d:%2d:%2d%*1[,.]%3d --> %d:%2d:%2d%*1[,.]%3d", - &s_hour, &s_min, &s_sec, &s_hsec, - &e_hour, &e_min, &e_sec, &e_hsec) == 8) { - s_min += 60 * s_hour; - e_min += 60 * e_hour; - s_sec += 60 * s_min; - - e_sec += 60 * e_min; - s_hsec += 1000 * s_sec; - e_hsec += 1000 * e_sec; - - duration = e_hsec - s_hsec; - } - *buf += ff_subtitles_next_line(*buf); - } - return duration; -} - -static int mkv_write_srt_blocks(AVFormatContext *s, AVIOContext *pb, - AVPacket *pkt) -{ - ebml_master blockgroup; - AVPacket pkt2 = *pkt; - int64_t duration = srt_get_duration(&pkt2.data); - pkt2.size -= pkt2.data - pkt->data; - - blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, - mkv_blockgroup_size(pkt2.size)); - mkv_write_block(s, pb, MATROSKA_ID_BLOCK, &pkt2, 0); - put_ebml_uint(pb, MATROSKA_ID_BLOCKDURATION, duration); - end_ebml_master(pb, blockgroup); - - return duration; -} - static int mkv_write_vtt_blocks(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt) { MatroskaMuxContext *mkv = s->priv_data; @@ -1757,9 +1716,7 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt, int add_ if (ret < 0) return ret; } } else { - if (codec->codec_id == AV_CODEC_ID_SRT) { - duration = mkv_write_srt_blocks(s, pb, pkt); - } else if (codec->codec_id == AV_CODEC_ID_WEBVTT) { + if (codec->codec_id == AV_CODEC_ID_WEBVTT) { duration = mkv_write_vtt_blocks(s, pb, pkt); } else { ebml_master blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, |