summaryrefslogtreecommitdiff
path: root/libavformat/mpegtsenc.c
diff options
context:
space:
mode:
authorDevin Heitmueller <devin.heitmueller@ltnglobal.com>2023-03-09 12:04:04 -0500
committerMarton Balint <cus@passwd.hu>2023-03-16 23:24:04 +0100
commit6273fb36ccefa38f4bd378d1611375492e70cac6 (patch)
treed684505c8358e2db39fa125e02095e3599d28681 /libavformat/mpegtsenc.c
parent14719b79394207df812fe7b6bc34fdee9f928ccb (diff)
downloadffmpeg-6273fb36ccefa38f4bd378d1611375492e70cac6.tar.gz
avformat/mpegtsenc: Restrict "async" behavior to KLV async packets
The original code would strip off the PTS/DTS of any packets which had a stream ID of STREAM_ID_PRIVATE_STREAM_1. While the intent was to apply this to asynchronous KLV packets, it was being applied to any codec that had that same stream ID (including types such as SMPTE 2038). Add a clause to the if() statement to ensure it only gets applied if the codec actually is KLV. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r--libavformat/mpegtsenc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index ceed089587..3f201cce1d 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1455,7 +1455,8 @@ static int get_pes_stream_id(AVFormatContext *s, AVStream *st, int stream_id, in
st->codecpar->codec_id == AV_CODEC_ID_TIMED_ID3) {
return STREAM_ID_PRIVATE_STREAM_1;
} else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) {
- if (stream_id == STREAM_ID_PRIVATE_STREAM_1) /* asynchronous KLV */
+ if (st->codecpar->codec_id == AV_CODEC_ID_SMPTE_KLV &&
+ stream_id == STREAM_ID_PRIVATE_STREAM_1) /* asynchronous KLV */
*async = 1;
return stream_id != -1 ? stream_id : STREAM_ID_METADATA_STREAM;
} else {