summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorCarlos Fernandez <carlos@ccextractor.org>2016-10-22 12:03:32 +0200
committerMarton Balint <cus@passwd.hu>2016-10-23 00:10:34 +0200
commit728ccae8a2c9910298e711be00e49eac988a31e5 (patch)
treeae9cfabce65a36df78bfa744d9ea8a23bfc6e2db /libavformat/mpegts.c
parentee7d6738ca694872f84ed62dd33342d187d76464 (diff)
downloadffmpeg-728ccae8a2c9910298e711be00e49eac988a31e5.tar.gz
lavf/mpegts: add missed fixes to scte35 section callback
They somehow got lost along the patch versions. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index cc2addcc9e..fad10c6b06 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1610,14 +1610,15 @@ static void scte_data_cb(MpegTSFilter *filter, const uint8_t *section,
MpegTSContext *ts = filter->u.section_filter.opaque;
int idx = ff_find_stream_index(ts->stream, filter->pid);
+ if (idx < 0)
+ return;
+
new_data_packet(section, section_len, ts->pkt);
- if (idx >= 0) {
- ts->pkt->stream_index = idx;
- }
+ ts->pkt->stream_index = idx;
prg = av_find_program_from_stream(ts->stream, NULL, idx);
if (prg && prg->pcr_pid != -1 && prg->discard != AVDISCARD_ALL) {
MpegTSFilter *f = ts->pids[prg->pcr_pid];
- if (f)
+ if (f && f->last_pcr != -1)
ts->pkt->pts = ts->pkt->dts = f->last_pcr/300;
}
ts->stop_parse = 1;