diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-05-21 22:52:21 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-05-21 22:52:21 +0000 |
commit | 5dae74e095ec4271c77547eda8864b52eae4e557 (patch) | |
tree | fe7e91d8fcfe05da11e723c6d6a0143f9f6bbf1d | |
parent | 56b8a7b72ae65cf303465cf99eb087914230f25b (diff) | |
download | ffmpeg-5dae74e095ec4271c77547eda8864b52eae4e557.tar.gz |
use duration from pkt
Originally committed as revision 13228 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/ffm.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/libavformat/ffm.c b/libavformat/ffm.c index fc7b35d879..6c79a9d733 100644 --- a/libavformat/ffm.c +++ b/libavformat/ffm.c @@ -247,16 +247,8 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) FFMStream *fst = st->priv_data; int64_t pts; uint8_t header[FRAME_HEADER_SIZE]; - int duration; int size= pkt->size; - //XXX/FIXME use duration from pkt - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { - duration = ((float)st->codec->frame_size / st->codec->sample_rate * 1000000.0); - } else { - duration = (1000000.0 * st->codec->time_base.num / (float)st->codec->time_base.den); - } - pts = fst->pts; /* packet size & key_frame */ header[0] = pkt->stream_index; @@ -264,7 +256,7 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) if (pkt->flags & PKT_FLAG_KEY) header[1] |= FLAG_KEY_FRAME; AV_WB24(header+2, size); - AV_WB24(header+5, duration); + AV_WB24(header+5, pkt->duration); ffm_write_data(s, header, FRAME_HEADER_SIZE, pts, 1); ffm_write_data(s, pkt->data, size, pts, 0); |