aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-03-05 11:22:11 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-03-31 21:20:39 +0100
commit5b4f8af2f1ac0595062dbb040db413633e9ef2fc (patch)
treec5866f97327c9d5ec2ca54dc36850a22477e3443 /libavcodec
parent3fafde6cbe345d2f84cfe61b94d4a823990969b3 (diff)
downloadffmpeg-5b4f8af2f1ac0595062dbb040db413633e9ef2fc.tar.gz
Add frame_size to AVCodecParameters
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h4
-rw-r--r--libavcodec/utils.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 4e8d30c6b0..10a208342d 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3889,6 +3889,10 @@ typedef struct AVCodecParameters {
* Corresponds to nBlockAlign in WAVEFORMATEX.
*/
int block_align;
+ /**
+ * Audio only. Audio frame size, if known. Required by some formats to be static.
+ */
+ int frame_size;
/**
* Audio only. The amount of padding (in samples) inserted by the encoder at
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 55a13799e5..034168625a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -3783,6 +3783,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par,
par->channels = codec->channels;
par->sample_rate = codec->sample_rate;
par->block_align = codec->block_align;
+ par->frame_size = codec->frame_size;
par->initial_padding = codec->initial_padding;
par->seek_preroll = codec->seek_preroll;
break;
@@ -3830,6 +3831,7 @@ int avcodec_parameters_to_context(AVCodecContext *codec,
codec->channels = par->channels;
codec->sample_rate = par->sample_rate;
codec->block_align = par->block_align;
+ codec->frame_size = par->frame_size;
codec->initial_padding = par->initial_padding;
codec->seek_preroll = par->seek_preroll;
break;