This patch implements the CARRIER_PRESENT event as outlined here;

https://lists.libav.org/pipermail/libav-devel/2015-June/069889.html

Regards,
John Högberg
From 163ff93fab1e0ec81f8f560d946dfe2a93e7c1d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20H=C3=B6gberg?= <john.hogb...@ericsson.com>
Date: Mon, 8 Jun 2015 11:04:35 +0200
Subject: [PATCH] mpegts: implement the CARRIER_PRESENT event.

---
 libavformat/mpegts.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 8f61f17..d1e0a7f 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -840,6 +840,10 @@ static int mpegts_push_data(MpegTSFilter *filter,
                     av_log(pes->stream, AV_LOG_TRACE, "pid=%x pes_code=%#x\n", 
pes->pid,
                             code);
 
+                    if(pes->st) {
+                        pes->st->event_flags |= 
AVSTREAM_EVENT_FLAG_CARRIER_PRESENT;
+                    }
+
                     if ((pes->st && pes->st->discard == AVDISCARD_ALL &&
                          (!pes->sub_st ||
                           pes->sub_st->discard == AVDISCARD_ALL)) ||
@@ -2379,7 +2383,7 @@ AVInputFormat ff_mpegts_demuxer = {
     .read_close     = mpegts_read_close,
     .read_seek      = read_seek,
     .read_timestamp = mpegts_get_pcr,
-    .flags          = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
+    .flags          = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT | AVFMT_SEPCARRIERS,
     .priv_class     = &mpegts_class,
 };
 
@@ -2392,6 +2396,6 @@ AVInputFormat ff_mpegtsraw_demuxer = {
     .read_close     = mpegts_read_close,
     .read_seek      = read_seek,
     .read_timestamp = mpegts_get_pcr,
-    .flags          = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
+    .flags          = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT | AVFMT_SEPCARRIERS,
     .priv_class     = &mpegtsraw_class,
 };
-- 
1.9.1

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to