Revision d80904cc

View differences:

ffserver.c
2159 2159
                    }
2160 2160
                } else {
2161 2161
                    AVCodecContext *codec;
2162

  
2162
                    AVStream *ist = c->fmt_in->streams[source_index];
2163
                    AVStream *ost = ctx->streams[pkt.stream_index];
2163 2164
                send_it:
2164 2165
                    /* specific handling for RTP: we use several
2165 2166
                       output stream (one for each RTP
......
2193 2194
                    } else {
2194 2195
                        ctx = &c->fmt_ctx;
2195 2196
                        /* Fudge here */
2196
                        codec = ctx->streams[pkt.stream_index]->codec;
2197
                        codec = ost->codec;
2197 2198
                    }
2198 2199

  
2199 2200
                    if (c->is_packetized) {
......
2212 2213
                    }
2213 2214
                    c->fmt_ctx.pb->is_streamed = 1;
2214 2215
                    if (pkt.dts != AV_NOPTS_VALUE)
2215
                        pkt.dts = av_rescale_q(pkt.dts,
2216
                                               c->fmt_in->streams[source_index]->time_base,
2217
                                               ctx->streams[pkt.stream_index]->time_base);
2216
                        pkt.dts = av_rescale_q(pkt.dts, ist->time_base, ost->time_base);
2218 2217
                    if (pkt.pts != AV_NOPTS_VALUE)
2219
                        pkt.pts = av_rescale_q(pkt.pts,
2220
                                               c->fmt_in->streams[source_index]->time_base,
2221
                                               ctx->streams[pkt.stream_index]->time_base);
2222
                    pkt.duration = av_rescale_q(pkt.duration,
2223
                                                c->fmt_in->streams[source_index]->time_base,
2224
                                                ctx->streams[pkt.stream_index]->time_base);
2218
                        pkt.pts = av_rescale_q(pkt.pts, ist->time_base, ost->time_base);
2219
                    pkt.duration = av_rescale_q(pkt.duration, ist->time_base, ost->time_base);
2225 2220
                    if (av_write_frame(ctx, &pkt) < 0) {
2226 2221
                        http_log("Error writing frame to output\n");
2227 2222
                        c->state = HTTPSTATE_SEND_DATA_TRAILER;

Also available in: Unified diff