diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2008-09-04 23:08:19 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-09-04 23:08:19 +0000 |
commit | 62c24705c84204fdcd44318d20caace076636eb1 (patch) | |
tree | 2d7ea635b22bdc785f2b5dbb4531d92b16bb11d8 /libavformat/matroskaenc.c | |
parent | 647148c638596a3aaac17a8f2a9547cb7b45212d (diff) | |
download | ffmpeg-62c24705c84204fdcd44318d20caace076636eb1.tar.gz |
matroska: subtitle display duration must be stored in pkt->convergence_duration
Originally committed as revision 15206 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r-- | libavformat/matroskaenc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index db090be049..ef3140ee8b 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -749,6 +749,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) ByteIOContext *pb = s->pb; AVCodecContext *codec = s->streams[pkt->stream_index]->codec; int keyframe = !!(pkt->flags & PKT_FLAG_KEY); + int duration = pkt->duration; int ret; // start a new cluster every 5 MB or 5 sec @@ -781,8 +782,9 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) mkv_write_block(s, MATROSKA_ID_SIMPLEBLOCK, pkt, keyframe << 7); } else { ebml_master blockgroup = start_ebml_master(pb, MATROSKA_ID_BLOCKGROUP, mkv_blockgroup_size(pkt)); + duration = pkt->convergence_duration; mkv_write_block(s, MATROSKA_ID_BLOCK, pkt, 0); - put_ebml_uint(pb, MATROSKA_ID_DURATION, pkt->duration); + put_ebml_uint(pb, MATROSKA_ID_DURATION, duration); end_ebml_master(pb, blockgroup); } @@ -791,7 +793,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) if (ret < 0) return ret; } - mkv->duration = FFMAX(mkv->duration, pkt->pts + pkt->duration); + mkv->duration = FFMAX(mkv->duration, pkt->pts + duration); return 0; } |