Mercurial > libavformat.hg
diff asf-enc.c @ 468:60f897e8dd2d libavformat
pass AVPacket into av_write_frame()
fixes the random dts/pts during encoding
asf preroll fix
no more initial zero frames for b frame encoding
mpeg-es dts during demuxing fixed
.ffm timestamp scale fixed, ffm is still broken though
author | michael |
---|---|
date | Sat, 29 May 2004 02:06:32 +0000 |
parents | b69898ffc92a |
children | 334e08488ad1 |
line wrap: on
line diff
--- a/asf-enc.c Tue May 25 23:06:00 2004 +0000 +++ b/asf-enc.c Sat May 29 02:06:32 2004 +0000 @@ -310,7 +310,7 @@ put_le64(pb, asf->nb_packets); /* number of packets */ put_le64(pb, asf->duration); /* end time stamp (in 100ns units) */ put_le64(pb, asf->duration); /* duration (in 100ns units) */ - put_le32(pb, 0); /* start time stamp */ + put_le32(pb, preroll_time); /* start time stamp */ put_le32(pb, 0); /* ??? */ put_le32(pb, asf->is_streamed ? 1 : 0); /* ??? */ put_le32(pb, asf->packet_size); /* packet size */ @@ -686,17 +686,17 @@ stream->seq++; } -static int asf_write_packet(AVFormatContext *s, int stream_index, - const uint8_t *buf, int size, int64_t timestamp) +static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) { ASFContext *asf = s->priv_data; ASFStream *stream; int64_t duration; AVCodecContext *codec; - codec = &s->streams[stream_index]->codec; - stream = &asf->streams[stream_index]; + codec = &s->streams[pkt->stream_index]->codec; + stream = &asf->streams[pkt->stream_index]; + //XXX /FIXME use duration from AVPacket if (codec->codec_type == CODEC_TYPE_AUDIO) { duration = (codec->frame_number * codec->frame_size * int64_t_C(10000000)) / codec->sample_rate; @@ -706,7 +706,7 @@ if (duration > asf->duration) asf->duration = duration; - put_frame(s, stream, timestamp, buf, size); + put_frame(s, stream, pkt->pts, pkt->data, pkt->size); return 0; }