Permalink
Browse files

libav: fixed compiling issues with more recent versions of libavcodec

  • Loading branch information...
1 parent 5513b44 commit 2a9ccdd8bc488bc6e08d794b584a690802ed804f John Törnblom committed Jun 7, 2013
Showing with 15 additions and 1 deletion.
  1. +13 −0 src/libav.c
  2. +1 −0 src/libav.h
  3. +1 −1 src/plumbing/transcoding.c
View
@@ -143,6 +143,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
+}
+
+/**
+ *
+ */
void
libav_init(void)
{
View
@@ -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))

0 comments on commit 2a9ccdd

Please sign in to comment.