Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Maintain compatibility for older versions of ffmpeg/libav which don't…
… have the AV_ prefix on CODEC_ID_*
  • Loading branch information
dreamcat4 authored and perexg committed Aug 6, 2014
1 parent 98826e3 commit f78015d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/libav.h
Expand Up @@ -23,6 +23,29 @@
#include <libavformat/avformat.h>
#include "tvheadend.h"

/*
Older versions of ffmpeg/libav don't have the AV_* prefix
For version info please see:
https://github.com/libav/libav/blob/a7153444df9040bf6ae103e0bbf6104b66f974cb/doc/APIchanges#L450-455
https://github.com/FFmpeg/FFmpeg/blob/97478ef5fe7dd2ff8da98e381de4a6b2b979b485/doc/APIchanges#L811-816
This list must be updated every time we use a new AV_CODEC_ID
*/
#ifndef AV_CODEC_ID_NONE
#define AV_CODEC_ID_AAC CODEC_ID_AAC
#define AV_CODEC_ID_AC3 CODEC_ID_AC3
#define AV_CODEC_ID_DVB CODEC_ID_DVB
#define AV_CODEC_ID_EAC3 CODEC_ID_EAC3
#define AV_CODEC_ID_H264 CODEC_ID_H264
#define AV_CODEC_ID_MP2 CODEC_ID_MP2
#define AV_CODEC_ID_MPEG2VIDEO CODEC_ID_MPEG2VIDEO
#define AV_CODEC_ID_NONE CODEC_ID_NONE
#define AV_CODEC_ID_TEXT CODEC_ID_TEXT
#define AV_CODEC_ID_VORBIS CODEC_ID_VORBIS
#define AV_CODEC_ID_VP8 CODEC_ID_VP8
#endif

enum AVCodecID streaming_component_type2codec_id(streaming_component_type_t type);
streaming_component_type_t codec_id2streaming_component_type(enum AVCodecID id);
int libav_is_encoder(AVCodec *codec);
Expand Down

0 comments on commit f78015d

Please sign in to comment.