History

avformat/mpegts: detect synchronous metadata KLV more reliably

The mpegts code historically tries to strip (the first) metadata access unit header from synchronous KLV metadata, but the detection for such streams was unreliable causing strips of asynchronous metadata or ID3 as well. MISB ST 1402 specifies required stream type, stream id and registration descriptor (which eventually maps to the codec ID) so let's use all of these for reliable detection. Fixes a regression caused by 468615f2045da325e0f73e8e668d49cf456ccb37. Fixes ticket #10828, #10883.

Marton Balint committed 2 years ago

Commit 0aaee471 parent c0a1ce11 file · +5 −2Browse files

Unified · Split

libavformat/mpegts.c+5−2
@@ -1307,8 +1307,11 @@ skip: · 1306 unmodified lines
1307 p += sl_header_bytes;1307 p += sl_header_bytes;
1308 buf_size -= sl_header_bytes;1308 buf_size -= sl_header_bytes;
1309 }1309 }
1310 if (pes->st->codecpar->codec_id == AV_CODEC_ID_SMPTE_KLV && buf_size >= 5) {1310 if (pes->stream_type == STREAM_TYPE_METADATA &&
1311 /* skip metadata access unit header */1311 pes->stream_id == STREAM_ID_METADATA_STREAM &&
1312 pes->st->codecpar->codec_id == AV_CODEC_ID_SMPTE_KLV &&
1313 buf_size >= 5) {
1314 /* skip metadata access unit header - see MISB ST 1402 */
1312 pes->pes_header_size += 5;1315 pes->pes_header_size += 5;
1313 p += 5;1316 p += 5;
1314 buf_size -= 5;1317 buf_size -= 5;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t