diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-05-30 01:44:35 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-05-30 01:44:35 +0000 |
commit | 084a89129294c07f2cd49c0fb7eae6a72f5e0aff (patch) | |
tree | 2ca795655bfcb073b1c987bcf6a16696c846c592 | |
parent | ddb41f3f5849aff314e8bf7d785624c356e568dd (diff) | |
download | ffmpeg-084a89129294c07f2cd49c0fb7eae6a72f5e0aff.tar.gz |
fix timestamps rescaling, index in source format might be different
Originally committed as revision 13546 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | ffserver.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ffserver.c b/ffserver.c index 8afd4936d1..04c16a0822 100644 --- a/ffserver.c +++ b/ffserver.c @@ -2078,6 +2078,7 @@ static int http_prepare_data(HTTPContext *c) } } } else { + int source_index = pkt.stream_index; /* update first pts if needed */ if (c->first_pts == AV_NOPTS_VALUE) { c->first_pts = av_rescale_q(pkt.dts, c->fmt_in->streams[pkt.stream_index]->time_base, AV_TIME_BASE_Q); @@ -2169,11 +2170,11 @@ static int http_prepare_data(HTTPContext *c) c->fmt_ctx.pb->is_streamed = 1; if (pkt.dts != AV_NOPTS_VALUE) pkt.dts = av_rescale_q(pkt.dts, - c->fmt_in->streams[pkt.stream_index]->time_base, + c->fmt_in->streams[source_index]->time_base, ctx->streams[pkt.stream_index]->time_base); if (pkt.pts != AV_NOPTS_VALUE) pkt.pts = av_rescale_q(pkt.pts, - c->fmt_in->streams[pkt.stream_index]->time_base, + c->fmt_in->streams[source_index]->time_base, ctx->streams[pkt.stream_index]->time_base); if (av_write_frame(ctx, &pkt)) c->state = HTTPSTATE_SEND_DATA_TRAILER; |