lavf/mpegtsenc: add special case for handling timed ID3 packets
authorStefano Sabatini <stefasab@gmail.com>
Tue, 19 Apr 2016 08:19:55 +0000 (10:19 +0200)
committerStefano Sabatini <stefasab@gmail.com>
Fri, 29 Jul 2016 06:47:41 +0000 (08:47 +0200)
Set the stream_id to 0xbd (private_stream_id_1). Tools seem to assume
that value, and this is consistent with MPEG TS specification (ITU-T
H.222.0 section 2.12.3).

libavformat/mpegtsenc.c

index b45a283..fd849e5 100644 (file)
@@ -1238,6 +1238,9 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
                         st->codecpar->codec_id == AV_CODEC_ID_AC3 &&
                         ts->m2ts_mode) {
                 *q++ = 0xfd;
+            } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA &&
+                       st->codecpar->codec_id == AV_CODEC_ID_TIMED_ID3) {
+                *q++ = 0xbd;
             } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) {
                 *q++ = stream_id != -1 ? stream_id : 0xfc;