if (force_pts) stream->pts = force_pts; stream->start_pts = stream->pts;
stream->start_pts = pts;
static int mpeg_mux_write_packet(AVFormatContext *ctx, int stream_index,                                 UINT8 *buf, int size, int force_pts){    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) {            if (force_pts)                stream->pts = force_pts;            stream->start_pts = stream->pts;        }        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;            flush_packet(ctx, stream_index, 0);        }    }    stream->pts += ticker_tick(&stream->pts_ticker, 1);    //if (st->codec.codec_type == CODEC_TYPE_VIDEO)    //    fprintf(stderr,"\nVideo PTS: %6lld", stream->pts);    //else    //    fprintf(stderr,"\nAudio PTS: %6lld", stream->pts);    return 0;}