avformat/mpegtsenc: set stream_id correctly based on KLV profile selected
authorBrad Hards <bradh@frogmouth.net>
Wed, 27 May 2020 10:02:00 +0000 (20:02 +1000)
committerMarton Balint <cus@passwd.hu>
Sun, 31 May 2020 16:43:02 +0000 (18:43 +0200)
Previously we always set STREAM_TYPE_PRIVATE_DATA, and that remains
the default value.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavformat/mpegtsenc.c

index ffa60f7..b5ee48d 100644 (file)
@@ -353,6 +353,13 @@ static int get_dvb_stream_type(AVFormatContext *s, AVStream *st)
     case AV_CODEC_ID_DVB_TELETEXT:
         stream_type = STREAM_TYPE_PRIVATE_DATA;
         break;
+    case AV_CODEC_ID_SMPTE_KLV:
+        if (st->codecpar->profile == FF_PROFILE_KLVA_SYNC) {
+            stream_type = STREAM_TYPE_METADATA;
+        } else {
+            stream_type = STREAM_TYPE_PRIVATE_DATA;
+        }
+        break;
     default:
         av_log_once(s, AV_LOG_WARNING, AV_LOG_DEBUG, &ts_st->data_st_warning,
                     "Stream %d, codec %s, is muxed as a private data stream "