From e02f30f8957adf09987c5bf2c7449f8241de7c8e Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 19 Feb 2023 02:10:14 +0100 Subject: [PATCH] Remove unnecessary error logs When a call to a packet or frame sink fails, do not log the error on the caller side: either the "failure" is expected (explicitly stopped) or it must be logged by the packet or frame sink implementation. --- app/src/decoder.c | 3 --- app/src/demuxer.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/app/src/decoder.c b/app/src/decoder.c index 9424ec1d..337aa329 100644 --- a/app/src/decoder.c +++ b/app/src/decoder.c @@ -29,7 +29,6 @@ sc_decoder_open_sinks(struct sc_decoder *decoder) { for (unsigned i = 0; i < decoder->sink_count; ++i) { struct sc_frame_sink *sink = decoder->sinks[i]; if (!sink->ops->open(sink)) { - LOGE("Could not open frame sink %d", i); sc_decoder_close_first_sinks(decoder, i); return false; } @@ -63,7 +62,6 @@ sc_decoder_open(struct sc_decoder *decoder, const AVCodec *codec) { } if (!sc_decoder_open_sinks(decoder)) { - LOGE("Could not open decoder sinks"); av_frame_free(&decoder->frame); avcodec_close(decoder->codec_ctx); avcodec_free_context(&decoder->codec_ctx); @@ -86,7 +84,6 @@ push_frame_to_sinks(struct sc_decoder *decoder, const AVFrame *frame) { for (unsigned i = 0; i < decoder->sink_count; ++i) { struct sc_frame_sink *sink = decoder->sinks[i]; if (!sink->ops->push(sink, frame)) { - LOGE("Could not send frame to sink %d", i); return false; } } diff --git a/app/src/demuxer.c b/app/src/demuxer.c index 3b26415b..c83d6bfa 100644 --- a/app/src/demuxer.c +++ b/app/src/demuxer.c @@ -111,7 +111,6 @@ push_packet_to_sinks(struct sc_demuxer *demuxer, const AVPacket *packet) { for (unsigned i = 0; i < demuxer->sink_count; ++i) { struct sc_packet_sink *sink = demuxer->sinks[i]; if (!sink->ops->push(sink, packet)) { - LOGE("Could not send packet to sink %d", i); return false; } } @@ -148,7 +147,6 @@ sc_demuxer_open_sinks(struct sc_demuxer *demuxer, const AVCodec *codec) { for (unsigned i = 0; i < demuxer->sink_count; ++i) { struct sc_packet_sink *sink = demuxer->sinks[i]; if (!sink->ops->open(sink, codec)) { - LOGE("Could not open packet sink %d", i); sc_demuxer_close_first_sinks(demuxer, i); return false; } @@ -184,7 +182,6 @@ run_demuxer(void *data) { } if (!sc_demuxer_open_sinks(demuxer, codec)) { - LOGE("Could not open demuxer sinks"); goto end; }