Commit e518ef5f authored by bcoudurier's avatar bcoudurier

use duration from pkt

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13228 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 75f4b69a
...@@ -247,16 +247,8 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -247,16 +247,8 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt)
FFMStream *fst = st->priv_data; FFMStream *fst = st->priv_data;
int64_t pts; int64_t pts;
uint8_t header[FRAME_HEADER_SIZE]; uint8_t header[FRAME_HEADER_SIZE];
int duration;
int size= pkt->size; 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; pts = fst->pts;
/* packet size & key_frame */ /* packet size & key_frame */
header[0] = pkt->stream_index; header[0] = pkt->stream_index;
...@@ -264,7 +256,7 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -264,7 +256,7 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt)
if (pkt->flags & PKT_FLAG_KEY) if (pkt->flags & PKT_FLAG_KEY)
header[1] |= FLAG_KEY_FRAME; header[1] |= FLAG_KEY_FRAME;
AV_WB24(header+2, size); 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, header, FRAME_HEADER_SIZE, pts, 1);
ffm_write_data(s, pkt->data, size, pts, 0); ffm_write_data(s, pkt->data, size, pts, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment