mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 03:40:30 +00:00
Lavc aud.: print error when open fails
This commit is contained in:
@@ -329,8 +329,10 @@ static bool reinitialize_coder(struct libavcodec_codec_state *s, struct audio_de
|
||||
|
||||
pthread_mutex_lock(s->libav_global_lock);
|
||||
/* open it */
|
||||
if (avcodec_open2(s->codec_ctx, s->codec, NULL) < 0) {
|
||||
fprintf(stderr, "Could not open codec\n");
|
||||
if (int ret = 0; (ret = avcodec_open2(s->codec_ctx, s->codec, nullptr)) < 0) {
|
||||
array<char, ERR_MSG_BUF_LEN> errbuf{};
|
||||
av_strerror(ret, errbuf.data(), errbuf.size());
|
||||
LOG(LOG_LEVEL_ERROR) << MOD_NAME << "Could not open codec: " << errbuf.data() << "(" << ret << ")\n";
|
||||
pthread_mutex_unlock(s->libav_global_lock);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user