Signed-off-by: Stephan Holljes <klaxa1...@googlemail.com> --- ffserver.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/ffserver.c b/ffserver.c index 39e1c32..bd7c694 100644 --- a/ffserver.c +++ b/ffserver.c @@ -127,13 +127,13 @@ void *read_thread(void *arg) pkt.dts = 0; } - pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, tb, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); - pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, tb, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); - pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, tb); - pkt.pos = -1; + //pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, tb, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); + //pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, tb, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); + //pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, tb); + //pkt.pos = -1; // current pts - pts = pkt.pts; //av_rescale_q(pkt.pts, in_stream->time_base, tb); + pts = av_rescale_q(pkt.pts, in_stream->time_base, tb); // current stream "uptime" now = av_gettime_relative() - start; @@ -249,8 +249,13 @@ void write_segment(struct Client *c) if (ret < 0) break; - pkt.dts = seg->ts[pkt_count]; - pkt.pts = seg->ts[pkt_count+1]; + pkt.dts = av_rescale_q_rnd(seg->ts[pkt_count], fmt_ctx->streams[pkt.stream_index]->time_base, + c->ofmt_ctx->streams[pkt.stream_index]->time_base, + AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); + pkt.pts = av_rescale_q_rnd(seg->ts[pkt_count+1], fmt_ctx->streams[pkt.stream_index]->time_base, + c->ofmt_ctx->streams[pkt.stream_index]->time_base, + AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX); + pkt.pos = -1; pkt_count += 2; ret = av_write_frame(c->ofmt_ctx, &pkt); av_packet_unref(&pkt); -- 2.16.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel