[FFmpeg-cvslog] avformat/mpegts: is_pes_stream() use switch case

Scott Theisen git at videolan.org
Wed Dec 4 00:15:36 EET 2024


ffmpeg | branch: master | Scott Theisen <scott.the.elm at gmail.com> | Sun Dec  1 00:14:14 2024 -0500| [5ba63f0ef1ea756400283ffc6d34d360c636ba7a] | committer: Marton Balint

avformat/mpegts: is_pes_stream() use switch case

also add STREAM_TYPE_PRIVATE_SECTION since a private_section() is not a
PES_packet().

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5ba63f0ef1ea756400283ffc6d34d360c636ba7a
---

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

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index fba08c3599..10589f798b 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2316,8 +2316,18 @@ static int parse_stream_identifier_desc(const uint8_t *p, const uint8_t *p_end)
 
 static int is_pes_stream(int stream_type, uint32_t prog_reg_desc)
 {
-    return !(stream_type == STREAM_TYPE_ISO_IEC_14496_SECTION ||
-             (stream_type == STREAM_TYPE_SCTE_DATA_SCTE_35 && prog_reg_desc == AV_RL32("CUEI")) );
+    switch (stream_type) {
+    case STREAM_TYPE_PRIVATE_SECTION:
+    case STREAM_TYPE_ISO_IEC_14496_SECTION:
+        return 0;
+    case STREAM_TYPE_SCTE_DATA_SCTE_35:
+        /* This User Private stream_type value is used by multiple organizations
+           for different things.  ANSI/SCTE 35 splice_info_section() is a
+           private_section() not a PES_packet(). */
+        return !(prog_reg_desc == AV_RL32("CUEI"));
+    default:
+        return 1;
+    }
 }
 
 static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)



More information about the ffmpeg-cvslog mailing list