From patchwork Wed Apr 22 11:26:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 19154 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id B344F449B47 for ; Wed, 22 Apr 2020 14:26:36 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8C78168BBBC; Wed, 22 Apr 2020 14:26:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8EBBA68BB43 for ; Wed, 22 Apr 2020 14:26:29 +0300 (EEST) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 496dRl65mGzKmjP for ; Wed, 22 Apr 2020 13:26:27 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id ee_jK-kB2LUc for ; Wed, 22 Apr 2020 13:26:24 +0200 (CEST) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Wed, 22 Apr 2020 16:56:08 +0530 Message-Id: <20200422112608.1538-1-ffmpeg@gyani.pro> MIME-Version: 1.0 X-Rspamd-Queue-Id: DB8AD1750 X-Rspamd-Score: 0.29 / 15.00 / 15.00 Subject: [FFmpeg-devel] [PATCH] avformat/mpegtsenc: use av_log_once for data stream warning X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavformat/mpegtsenc.c | 15 +++++++++++---- 1 file 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; }