Log recording failure
If recording fails, log "recording failed" instead of "recording complete".
This commit is contained in:
parent
d4ed8b6f26
commit
6abb4902c6
1 changed files with 7 additions and 2 deletions
|
@ -216,12 +216,17 @@ recorder_close(struct recorder *recorder) {
|
||||||
int ret = av_write_trailer(recorder->ctx);
|
int ret = av_write_trailer(recorder->ctx);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
LOGE("Failed to write trailer to %s", recorder->filename);
|
LOGE("Failed to write trailer to %s", recorder->filename);
|
||||||
|
recorder->failed = true;
|
||||||
}
|
}
|
||||||
avio_close(recorder->ctx->pb);
|
avio_close(recorder->ctx->pb);
|
||||||
avformat_free_context(recorder->ctx);
|
avformat_free_context(recorder->ctx);
|
||||||
|
|
||||||
const char *format_name = recorder_get_format_name(recorder->format);
|
if (recorder->failed) {
|
||||||
LOGI("Recording complete to %s file: %s", format_name, recorder->filename);
|
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
|
static bool
|
||||||
|
|
Loading…
Reference in a new issue