diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-03-30 17:15:04 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-03-31 21:20:39 +0100 |
commit | dd77dad4e6ff59bb5ba888341e28ce620cc16ae0 (patch) | |
tree | dc78a23bdc8c900dfc2ba7f4c3ca1f10d3e8fb09 | |
parent | 5b4f8af2f1ac0595062dbb040db413633e9ef2fc (diff) | |
download | ffmpeg-dd77dad4e6ff59bb5ba888341e28ce620cc16ae0.tar.gz |
codecpar: Add video delay field
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
-rw-r--r-- | libavcodec/avcodec.h | 5 | ||||
-rw-r--r-- | libavcodec/utils.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 10a208342d..bbf742f351 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3869,6 +3869,11 @@ typedef struct AVCodecParameters { enum AVChromaLocation chroma_location; /** + * Video only. Number of delayed frames. + */ + int video_delay; + + /** * Audio only. The channel layout bitmask. May be 0 if the channel layout is * unknown or unspecified, otherwise the number of bits set must be equal to * the channels field. diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 034168625a..5288d4d6b0 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -3776,6 +3776,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par, par->color_space = codec->colorspace; par->chroma_location = codec->chroma_sample_location; par->sample_aspect_ratio = codec->sample_aspect_ratio; + par->video_delay = codec->has_b_frames; break; case AVMEDIA_TYPE_AUDIO: par->format = codec->sample_fmt; @@ -3824,6 +3825,7 @@ int avcodec_parameters_to_context(AVCodecContext *codec, codec->colorspace = par->color_space; codec->chroma_sample_location = par->chroma_location; codec->sample_aspect_ratio = par->sample_aspect_ratio; + codec->has_b_frames = par->video_delay; break; case AVMEDIA_TYPE_AUDIO: codec->sample_fmt = par->format; |