summaryrefslogtreecommitdiffstats
path: root/ffserver.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-11-01 13:44:59 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-11 15:13:37 +0100
commit64e220beb5fb7f32800c1eed1e9e903022e41d19 (patch)
tree00fcc48b04bb489427fd3566926cea76aaf83515 /ffserver.c
parent363673fbe0e182b96556f933d47e223eb477badb (diff)
downloadffmpeg-streaming-64e220beb5fb7f32800c1eed1e9e903022e41d19.zip
ffmpeg-streaming-64e220beb5fb7f32800c1eed1e9e903022e41d19.tar.gz
ffserver: Do not add or rescale AV_NOPTS_VALUE from the demuxer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffserver.c')
-rw-r--r--ffserver.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ffserver.c b/ffserver.c
index 577ca6f..a32ba08 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2276,7 +2276,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;
}
@@ -2315,8 +2315,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;
OpenPOWER on IntegriCloud