[FFmpeg-devel] [PATCH 1/2] ffserver: Do not add or rescale AV_NOPTS_VALUE from the demuxer
Michael Niedermayer
michaelni at gmx.at
Sun Nov 1 18:34:43 CET 2015
From: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
ffserver.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/ffserver.c b/ffserver.c
index 526cbfc..8ddc210 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2272,7 +2272,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) {
+ if (c->first_pts == AV_NOPTS_VALUE && pkt.dts != AV_NOPTS_VALUE) {
c->first_pts = av_rescale_q(pkt.dts, c->fmt_in->streams[pkt.stream_index]->time_base, AV_TIME_BASE_Q);
c->start_time = cur_time;
}
@@ -2311,8 +2311,10 @@ static int http_prepare_data(HTTPContext *c)
* XXX: need more abstract handling */
if (c->is_packetized) {
/* compute send time and duration */
- c->cur_pts = av_rescale_q(pkt.dts, ist->time_base, AV_TIME_BASE_Q);
- c->cur_pts -= c->first_pts;
+ if (pkt.dts != AV_NOPTS_VALUE) {
+ c->cur_pts = av_rescale_q(pkt.dts, ist->time_base, AV_TIME_BASE_Q);
+ c->cur_pts -= c->first_pts;
+ }
c->cur_frame_duration = av_rescale_q(pkt.duration, ist->time_base, AV_TIME_BASE_Q);
/* find RTP context */
c->packet_stream_index = pkt.stream_index;
--
1.7.9.5
More information about the ffmpeg-devel
mailing list