From patchwork Sat Oct 22 10:10:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 1127 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp1415703vsd; Sat, 22 Oct 2016 03:10:27 -0700 (PDT) X-Received: by 10.194.105.41 with SMTP id gj9mr4970121wjb.58.1477131027438; Sat, 22 Oct 2016 03:10:27 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t79si2521735wmd.7.2016.10.22.03.10.27; Sat, 22 Oct 2016 03:10:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ECC26689C12; Sat, 22 Oct 2016 13:10:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 466316898D9 for ; Sat, 22 Oct 2016 13:10:15 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 7B9E7100BEB; Sat, 22 Oct 2016 12:10:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2d1Q6ArtCyNH; Sat, 22 Oct 2016 12:10:17 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 13A3CFF847; Sat, 22 Oct 2016 12:10:17 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sat, 22 Oct 2016 12:10:13 +0200 Message-Id: <1477131013-30419-1-git-send-email-cus@passwd.hu> X-Mailer: git-send-email 2.6.6 Subject: [FFmpeg-devel] [PATCH] lavf/mpegts: add missed fixes to scte35 section callback X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Carlos Fernandez Sanz , Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" They somehow got lost along the patch versions. Signed-off-by: Marton Balint --- libavformat/mpegts.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 97a2225..bcc13e3 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;