Fix bug in video stream when incoming RTP packet timestamp rolls over. (#2584)
This commit is contained in:
parent
2701e5eab6
commit
0d911f82d0
|
@ -1295,6 +1295,7 @@ static pj_status_t decode_frame(pjmedia_vid_stream *stream,
|
||||||
{
|
{
|
||||||
pjmedia_vid_channel *channel = stream->dec;
|
pjmedia_vid_channel *channel = stream->dec;
|
||||||
pj_uint32_t last_ts = 0, frm_ts = 0;
|
pj_uint32_t last_ts = 0, frm_ts = 0;
|
||||||
|
pj_bool_t last_ts_inited = PJ_FALSE;
|
||||||
int frm_first_seq = 0, frm_last_seq = 0;
|
int frm_first_seq = 0, frm_last_seq = 0;
|
||||||
pj_bool_t got_frame = PJ_FALSE;
|
pj_bool_t got_frame = PJ_FALSE;
|
||||||
unsigned cnt, frm_pkt_cnt = 0, frm_cnt = 0;
|
unsigned cnt, frm_pkt_cnt = 0, frm_cnt = 0;
|
||||||
|
@ -1320,12 +1321,13 @@ static pj_status_t decode_frame(pjmedia_vid_stream *stream,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (last_ts == 0) {
|
if (!last_ts_inited) {
|
||||||
last_ts = ts;
|
last_ts = ts;
|
||||||
|
|
||||||
/* Init timestamp and first seq of the first frame */
|
/* Init timestamp and first seq of the first frame */
|
||||||
frm_ts = ts;
|
frm_ts = ts;
|
||||||
frm_first_seq = seq;
|
frm_first_seq = seq;
|
||||||
|
last_ts_inited = PJ_TRUE;
|
||||||
}
|
}
|
||||||
if (ts != last_ts) {
|
if (ts != last_ts) {
|
||||||
last_ts = ts;
|
last_ts = ts;
|
||||||
|
|
Loading…
Reference in New Issue