stream->start_pts = stream->pts * 90000.0;
stream->start_pts = stream->pts;
static int mpeg_mux_write_packet(AVFormatContext *ctx,                                  int stream_index, UINT8 *buf, int size){    MpegMuxContext *s = ctx->priv_data;    AVStream *st = ctx->streams[stream_index];    StreamInfo *stream = st->priv_data;    int len;    while (size > 0) {        /* set pts */        if (stream->start_pts == -1)            stream->start_pts = stream->pts * 90000.0;        len = s->packet_data_max_size - stream->buffer_ptr;        if (len > size)            len = size;        memcpy(stream->buffer + stream->buffer_ptr, buf, len);        stream->buffer_ptr += len;        buf += len;        size -= len;        while (stream->buffer_ptr >= s->packet_data_max_size) {            /* output the packet */            if (stream->start_pts == -1)                stream->start_pts = stream->pts * 90000.0;            flush_packet(ctx, stream_index);        }    }    if (st->codec.codec_type == CODEC_TYPE_AUDIO) {        stream->pts += (float)st->codec.frame_size / st->codec.sample_rate;    } else {        stream->pts += FRAME_RATE_BASE / (float)st->codec.frame_rate;    }    return 0;}