Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: fix the dts_offset initialization from backlog
  • Loading branch information
perexg committed Nov 22, 2015
1 parent 5cb5a0c commit 7e0e78c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/dvr/dvr_rec.c
Expand Up @@ -1279,21 +1279,19 @@ dvr_thread(void *aux)
muxing = 1;
while ((sm2 = TAILQ_FIRST(&backlog)) != NULL) {
TAILQ_REMOVE(&backlog, sm2, sm_link);
if (pkt->pkt_dts != PTS_UNSET) {
if (dts_offset == PTS_UNSET) {
pkt2 = sm2->sm_data;
pkt2 = sm2->sm_data;
if (pkt2->pkt_dts != PTS_UNSET) {
if (dts_offset == PTS_UNSET)
dts_offset = pkt2->pkt_dts;
}
pkt3 = (th_pkt_t *)sm2->sm_data;
if (dts_pts_valid(pkt3, dts_offset)) {
pkt3 = pkt_copy_shallow(pkt3);
if (dts_pts_valid(pkt2, dts_offset)) {
pkt3 = pkt_copy_shallow(pkt2);
pkt3->pkt_dts -= dts_offset;
if (pkt3->pkt_pts != PTS_UNSET)
pkt3->pkt_pts -= dts_offset;
dvr_thread_pkt_stats(de, pkt3, 1);
muxer_write_pkt(prch->prch_muxer, sm2->sm_type, pkt3);
} else {
dvr_thread_pkt_stats(de, pkt3, 0);
dvr_thread_pkt_stats(de, pkt2, 0);
}
}
streaming_msg_free(sm2);
Expand Down

0 comments on commit 7e0e78c

Please sign in to comment.