Use our new CODEC define to cleanup the code

pull/3204/head
Isaac Connor 2021-03-27 14:44:01 -04:00
parent d3ed11cc5b
commit 0bfbdd6121
1 changed files with 5 additions and 1 deletions

View File

@ -3145,7 +3145,8 @@ int Monitor::PrimeCapture() {
}
if (record_audio and (audio_stream_id >= 0)) {
AVStream *audioStream = camera->getAudioStream();
snprintf(shared_data->audio_fifo_path, sizeof(shared_data->audio_fifo_path)-1, "%s/video_fifo_%d.%s",
if (audioStream && CODEC(audioStream)) {
snprintf(shared_data->audio_fifo_path, sizeof(shared_data->audio_fifo_path)-1, "%s/audio_fifo_%d.%s",
staticConfig.PATH_SOCKS.c_str(), id,
#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0)
avcodec_get_name(audioStream->codecpar->codec_id)
@ -3154,6 +3155,9 @@ int Monitor::PrimeCapture() {
#endif
);
audio_fifo = new Fifo(shared_data->audio_fifo_path, true);
} else {
Warning("No audioStream %p or codec?", audioStream);
}
}
} // end if rtsp_server