[FFmpeg-devel] [PATCH] Fix: Branch condition of KLV metadata AU header remover.

Motoki Shimizu moshimiz at yahoo-corp.jp
Mon Aug 6 10:18:41 EEST 2018


KLV metadata access unit header remover has an effect on the other unrelated Packetized metadata.
Branch condition code should be modified to check the codec_id.
---
 libavformat/mpegts.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index a5cb17a..bc6bdc6 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1208,7 +1208,9 @@ skip:
                     p += sl_header_bytes;
                     buf_size -= sl_header_bytes;
                 }
-                if (pes->stream_type == 0x15 && buf_size >= 5) {
+                if (pes->stream_type == 0x15 &&
+                    pes->st->codecpar->codec_id == AV_CODEC_ID_SMPTE_KLV &&
+                    buf_size >= 5) {
                     /* skip metadata access unit header */
                     pes->pes_header_size += 5;
                     p += 5;
--
1.8.3.1



More information about the ffmpeg-devel mailing list