[FFmpeg-cvslog] r13546 - trunk/ffserver.c

bcoudurier subversion
Fri May 30 03:44:35 CEST 2008


Author: bcoudurier
Date: Fri May 30 03:44:35 2008
New Revision: 13546

Log:
fix timestamps rescaling, index in source format might be different

Modified:
   trunk/ffserver.c

Modified: trunk/ffserver.c
==============================================================================
--- trunk/ffserver.c	(original)
+++ trunk/ffserver.c	Fri May 30 03:44:35 2008
@@ -2078,6 +2078,7 @@ static int http_prepare_data(HTTPContext
                     }
                 }
             } 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->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;




More information about the ffmpeg-cvslog mailing list