diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-11 16:07:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-12 14:51:19 +0200 |
commit | da74e883f14469a1aad7c07c9aa7629a554bbceb (patch) | |
tree | daf46b8b917697ab4eb0df2c982ce7a6192cafd9 /libavcodec/utils.c | |
parent | d0bf3bf1ffaf810d8e0737847666a9b86ea5929f (diff) | |
download | ffmpeg-da74e883f14469a1aad7c07c9aa7629a554bbceb.tar.gz |
lavc: add codec_descriptor field to AVCodecContext.
This can be used to avoid a time consuming lookup of the
descriptor
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index d9ad10f021..90df647db7 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -712,6 +712,7 @@ MAKE_ACCESSORS(AVFrame, frame, AVDictionary *, metadata) MAKE_ACCESSORS(AVFrame, frame, int, decode_error_flags) MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase) +MAKE_ACCESSORS(AVCodecContext, codec, AVCodecDescriptor*, codec_descriptor) static void avcodec_get_subtitle_defaults(AVSubtitle *sub) { @@ -860,6 +861,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD goto free_and_end; } avctx->frame_number = 0; + avctx->codec_descriptor = avcodec_descriptor_get(avctx->codec_id); if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && (!avctx->time_base.num || !avctx->time_base.den)) { |