From 6abb4902c60169132bfa0c9bd6cc56fa8580e7c0 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 31 Jul 2019 11:04:38 +0200 Subject: [PATCH] Log recording failure If recording fails, log "recording failed" instead of "recording complete". --- app/src/recorder.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/recorder.c b/app/src/recorder.c index c36e3f91..63a1400e 100644 --- a/app/src/recorder.c +++ b/app/src/recorder.c @@ -216,12 +216,17 @@ recorder_close(struct recorder *recorder) { int ret = av_write_trailer(recorder->ctx); if (ret < 0) { LOGE("Failed to write trailer to %s", recorder->filename); + recorder->failed = true; } avio_close(recorder->ctx->pb); avformat_free_context(recorder->ctx); - const char *format_name = recorder_get_format_name(recorder->format); - LOGI("Recording complete to %s file: %s", format_name, recorder->filename); + if (recorder->failed) { + LOGE("Recording failed to %s", recorder->filename); + } else { + const char *format_name = recorder_get_format_name(recorder->format); + LOGI("Recording complete to %s file: %s", format_name, recorder->filename); + } } static bool