summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pjmedia/src/pjmedia-codec/ffmpeg_codecs.c2
-rw-r--r--pjmedia/src/pjmedia/vid_stream.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/pjmedia/src/pjmedia-codec/ffmpeg_codecs.c b/pjmedia/src/pjmedia-codec/ffmpeg_codecs.c
index d02e8250..72159762 100644
--- a/pjmedia/src/pjmedia-codec/ffmpeg_codecs.c
+++ b/pjmedia/src/pjmedia-codec/ffmpeg_codecs.c
@@ -923,7 +923,7 @@ static pj_status_t ffmpeg_default_attr( pjmedia_vid_codec_factory *factory,
/* Decoded format */
pjmedia_format_init_video(&attr->dec_fmt, desc->info.dec_fmt_id[0],
desc->size.w, desc->size.h,
- desc->fps.num*3/2, desc->fps.denum);
+ desc->fps.num, desc->fps.denum);
/* Decoding fmtp */
attr->dec_fmtp = desc->dec_fmtp;
diff --git a/pjmedia/src/pjmedia/vid_stream.c b/pjmedia/src/pjmedia/vid_stream.c
index 64bf0d7f..478b206f 100644
--- a/pjmedia/src/pjmedia/vid_stream.c
+++ b/pjmedia/src/pjmedia/vid_stream.c
@@ -1392,6 +1392,15 @@ PJ_DEF(pj_status_t) pjmedia_vid_stream_create(
stream->frame_ts_len = info->codec_info.clock_rate *
vfd_enc->fps.denum / vfd_enc->fps.num;
+ /* Override the initial framerate in the decoding direction. This initial
+ * value will be used by the renderer to configure its clock, and setting
+ * it to a bit higher value can avoid the possibility of high latency
+ * caused by clock drift (remote encoder clock runs slightly faster than
+ * local renderer clock) or video setup lag. Note that the actual framerate
+ * will be continuously calculated based on the incoming RTP timestamps.
+ */
+ vfd_dec->fps.num = vfd_dec->fps.num * 3 / 2;
+
/* Create decoder channel */
status = create_channel( pool, stream, PJMEDIA_DIR_DECODING,
info->rx_pt, info, &stream->dec);