Add frame_size to AVCodecParameters
authorHendrik Leppkes <h.leppkes@gmail.com>
Sat, 5 Mar 2016 10:22:11 +0000 (11:22 +0100)
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>
Thu, 31 Mar 2016 20:20:39 +0000 (21:20 +0100)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
libavcodec/avcodec.h
libavcodec/utils.c

index 4e8d30c..10a2083 100644 (file)
@@ -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
index 55a1379..0341686 100644 (file)
@@ -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;