[FFmpeg-devel] [PATCH] avdevice/decklink_dec: fix no warning message if no input signal detected
Marton Balint
cus at passwd.hu
Sat Jun 20 02:31:43 EEST 2020
On Sat, 20 Jun 2020, lance.lmwang at gmail.com wrote:
> On Fri, Jun 19, 2020 at 10:46:33PM +0200, Marton Balint wrote:
>>
>>
>> On Fri, 19 Jun 2020, Limin Wang wrote:
>>
>> > On Thu, Jun 18, 2020 at 07:37:50PM +0200, Marton Balint wrote:
>> > >
>> > >
>> > > On Thu, 18 Jun 2020, lance.lmwang at gmail.com wrote:
>> > >
>> > > >From: Limin Wang <lance.lmwang at gmail.com>
>> > > >
>> > > >Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
>> > > >---
>> > > >libavdevice/decklink_dec.cpp | 2 +-
>> > > >1 file changed, 1 insertion(+), 1 deletion(-)
>> > > >
>> > > >diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
>> > > >index 82106aa..90569dc 100644
>> > > >--- a/libavdevice/decklink_dec.cpp
>> > > >+++ b/libavdevice/decklink_dec.cpp
>> > > >@@ -751,7 +751,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived(
>> > > > }
>> > > > }
>> > > >
>> > > >- if (!no_video) {
>> > > >+ if (no_video) {
>> > > > av_log(avctx, AV_LOG_WARNING, "Frame received (#%lu) - No input signal detected "
>> > > > "- Frames dropped %u\n", ctx->frameCount, ++ctx->dropped);
>> > > > }
>> > >
>> > > No, this is good as is, the !no_video condition ensures that it is
>> > > only logged once when the input actually disappears, and not for
>> > > every consecutive frame with no input.
>> >
>> > It's good point, but if no input signal after run, no any warning message.
>>
>> I don't understand what you are saying here.
>>
>> > I don't think it's helpful to check the signal status,
>>
>> What do you mean?
>
> If no_video is status machine of signal, then the first status is 1(no signal).
> So I think it's wrong to initialized to 0. So if the input signal is lost,
> no any warning message then. I'll submit a patch for your review.
initially no_video = 0, so we assume there is valid signal. When there is
no signal, we log the warning if no_video==0, and we set no_video to 1. So
we do give warning message when the signal is lost.
>
>>
>> > also the dropped message isn't correct then, as it'll not count for
>> > every dropped frame by the condition.
>>
>> That is true, a patch which fixes the number of dropped frames only is
>> welcome.
>
> I'll submit a patch for that. I prefer to print warning message by dropped %
> 25(or other mod), it's more helpful.
Sorry, i don't think so.
Regards,
Marton
More information about the ffmpeg-devel
mailing list