summaryrefslogtreecommitdiff
path: root/libavformat/mpegtsenc.c
diff options
context:
space:
mode:
authorGyan Doshi <ffmpeg@gyani.pro>2020-04-22 16:53:51 +0530
committerGyan Doshi <ffmpeg@gyani.pro>2020-04-23 11:31:35 +0530
commitfc8a239e9d0a0eeadcd4f5e93a3de56bd68ac8ed (patch)
tree03db4b762b30898a80edcc327ba8db1d8d13cb76 /libavformat/mpegtsenc.c
parent54f100272a363d119bc862df23c6191676b97ea7 (diff)
avformat/mpegtsenc: use av_log_once for data stream warning
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r--libavformat/mpegtsenc.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 4fe3d84c59..f2be6c6632 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -238,6 +238,7 @@ typedef struct MpegTSWriteStream {
int payload_flags;
uint8_t *payload;
AVFormatContext *amux;
+ int data_st_warning;
int64_t pcr_period; /* PCR period in PCR time base */
int64_t last_pcr;
@@ -285,6 +286,7 @@ static void put_registration_descriptor(uint8_t **q_ptr, uint32_t tag)
static int get_dvb_stream_type(AVFormatContext *s, AVStream *st)
{
MpegTSWrite *ts = s->priv_data;
+ MpegTSWriteStream *ts_st = st->priv_data;
int stream_type;
switch (st->codecpar->codec_id) {
@@ -354,8 +356,10 @@ static int get_dvb_stream_type(AVFormatContext *s, AVStream *st)
stream_type = STREAM_TYPE_PRIVATE_DATA;
break;
default:
- av_log(s, AV_LOG_WARNING, "Stream %d, codec %s, is muxed as a private data stream "
- "and may not be recognized upon reading.\n", st->index, avcodec_get_name(st->codecpar->codec_id));
+ 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 "
+ "and may not be recognized upon reading.\n", st->index,
+ avcodec_get_name(st->codecpar->codec_id));
stream_type = STREAM_TYPE_PRIVATE_DATA;
break;
}
@@ -366,6 +370,7 @@ static int get_dvb_stream_type(AVFormatContext *s, AVStream *st)
static int get_m2ts_stream_type(AVFormatContext *s, AVStream *st)
{
int stream_type;
+ MpegTSWriteStream *ts_st = st->priv_data;
switch (st->codecpar->codec_id) {
case AV_CODEC_ID_MPEG2VIDEO:
@@ -402,8 +407,10 @@ static int get_m2ts_stream_type(AVFormatContext *s, AVStream *st)
stream_type = 0x92;
break;
default:
- av_log(s, AV_LOG_WARNING, "Stream %d, codec %s, is muxed as a private data stream "
- "and may not be recognized upon reading.\n", st->index, avcodec_get_name(st->codecpar->codec_id));
+ 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 "
+ "and may not be recognized upon reading.\n", st->index,
+ avcodec_get_name(st->codecpar->codec_id));
stream_type = STREAM_TYPE_PRIVATE_DATA;
break;
}