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,13 +216,18 @@ 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);
|
||||
|
||||
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
|
||||
recorder_write_header(struct recorder *recorder, const AVPacket *packet) {
|
||||
|
|
Loading…
Reference in a new issue