From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5F40145749 for ; Sat, 22 Jul 2023 14:11:25 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 840EE68C584; Sat, 22 Jul 2023 17:11:15 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 33DB568C4C9 for ; Sat, 22 Jul 2023 17:11:08 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 859FA1BF204 for ; Sat, 22 Jul 2023 14:11:07 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 22 Jul 2023 16:11:01 +0200 Message-Id: <20230722141104.3327415-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230722141104.3327415-1-michael@niedermayer.cc> References: <20230722141104.3327415-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/5] avradio/vissualize: change color of the active station X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: Michael Niedermayer --- libavradio/vissualize.c | 6 ++++-- tests/ref/fate/sdr-am | 2 +- tests/ref/fate/sdr-fm | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libavradio/vissualize.c b/libavradio/vissualize.c index 2d397546dc..15d7f9e95f 100644 --- a/libavradio/vissualize.c +++ b/libavradio/vissualize.c @@ -219,9 +219,11 @@ int ff_sdr_vissualization(SDRContext *sdr, AVStream *st, AVPacket *pkt) } else { snprintf(text, sizeof(text), "%s ", ff_sdr_modulation_descs[s->modulation].shortname); } - av_strlcatf(text, sizeof(text), "%f Mhz %d %d %d", + draw_string(pkt->data, 4*w, text, xmid + 8*yd, 320*h2, xd, yd, color, color, color*(s->stream ? 2 : 1), w, h, 0); + pos = strlen(text); + snprintf(text, sizeof(text), "%f Mhz %d %d %d", f/1000000, (int)s->score, ff_sdr_histogram_score(s), s->timeout); - draw_string(pkt->data, 4*w, text, xmid + 8*yd, 320*h2, xd, yd, color, color, color, w, h, 0); + draw_string(pkt->data, 4*w, text, xmid + 8*yd, 320*h2, xd, yd, color, color, color, w, h, pos); if (s->radiotext[0]) { draw_string(pkt->data, 4*w, s->radiotext, xmid + 8*yd, 320*h2 + 24*yd, xd, yd, color, color, color, w, h, 0); } diff --git a/tests/ref/fate/sdr-am b/tests/ref/fate/sdr-am index d0fdc48cf5..b8a34ee488 100644 --- a/tests/ref/fate/sdr-am +++ b/tests/ref/fate/sdr-am @@ -52,4 +52,4 @@ 4, 4096, 4096, 1024, 2048, 0xdcd6ff8d 5, 4096, 4096, 1024, 2048, 0xedac0493 6, 4096, 4096, 1024, 2048, 0x970a0066 -0, 3, 3, 1, 320000, 0x73e13a75 +0, 3, 3, 1, 320000, 0x9fb0c309 diff --git a/tests/ref/fate/sdr-fm b/tests/ref/fate/sdr-fm index 0a3aaa48d4..3ae5adc2c0 100644 --- a/tests/ref/fate/sdr-fm +++ b/tests/ref/fate/sdr-fm @@ -19,7 +19,7 @@ 2, 8196, 8196, 4096, 8192, 0xb966fb19 1, 12292, 12292, 4096, 8192, 0x6d8ffe6e 2, 12292, 12292, 4096, 8192, 0x51d1fb50 -0, 3, 3, 1, 320000, 0x1b178638 +0, 3, 3, 1, 320000, 0xf8b7b144 1, 16388, 16388, 4096, 8192, 0x8c000600 2, 16388, 16388, 4096, 8192, 0x335ff20c -0, 4, 4, 1, 320000, 0x49dd90cc +0, 4, 4, 1, 320000, 0xab42bbc7 -- 2.31.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".