Skip to content

Commit

Permalink
Check libavcodec version to properly define avcodec_find_encoder retu…
Browse files Browse the repository at this point in the history
…rn value
  • Loading branch information
atoppi committed Sep 22, 2022
1 parent d88976e commit 46364c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/postprocessing/pp-h264.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ int janus_pp_h264_create(char *destination, char *metadata, gboolean faststart,
char filename[1024];
snprintf(filename, sizeof(filename), "%s", destination);
#ifdef USE_CODECPAR
#if LIBAVCODEC_VER_AT_LEAST(59, 18)
const AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_H264);
#else
AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_H264);
#endif
if(!codec) {
/* Error opening video codec */
JANUS_LOG(LOG_ERR, "Encoder not available\n");
Expand Down
4 changes: 4 additions & 0 deletions src/postprocessing/pp-h265.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ int janus_pp_h265_create(char *destination, char *metadata, gboolean faststart,
char filename[1024];
snprintf(filename, sizeof(filename), "%s", destination);
#ifdef USE_CODECPAR
#if LIBAVCODEC_VER_AT_LEAST(59, 18)
const AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_H265);
#else
AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_H265);
#endif
if(!codec) {
/* Error opening video codec */
JANUS_LOG(LOG_ERR, "Encoder not available\n");
Expand Down

0 comments on commit 46364c6

Please sign in to comment.