libav: fixed compiling issues with more recent versions of libavcodec
This commit is contained in:
parent
5513b44f30
commit
2a9ccdd8bc
3 changed files with 15 additions and 1 deletions
13
src/libav.c
13
src/libav.c
|
@ -140,6 +140,19 @@ codec_id2streaming_component_type(enum CodecID id)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
int
|
||||
libav_is_encoder(AVCodec *codec)
|
||||
{
|
||||
#if LIBAVCODEC_VERSION_INT >= ((54<<16)+(7<<8)+0)
|
||||
return av_codec_is_encoder(codec);
|
||||
#else
|
||||
return codec->encode || codec->encode2;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
enum CodecID streaming_component_type2codec_id(streaming_component_type_t type);
|
||||
streaming_component_type_t codec_id2streaming_component_type(enum CodecID id);
|
||||
int libav_is_encoder(AVCodec *codec);
|
||||
void libav_init(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1317,7 +1317,7 @@ transcoder_get_capabilities(htsmsg_t *array)
|
|||
|
||||
while ((p = av_codec_next(p))) {
|
||||
|
||||
if (!p->encode && !p->encode2)
|
||||
if (!libav_is_encoder(p))
|
||||
continue;
|
||||
|
||||
if (!WORKING_ENCODER(p->id))
|
||||
|
|
Loading…
Add table
Reference in a new issue