diff mbox series

[FFmpeg-devel,PATCH5] avcodec/codec_par: Reorder AVCodecParameters fields

Message ID 20240304180613.7280-1-jamrial@gmail.com
State Accepted
Commit 823d60d55e68c9b4e33015c97cdb78cc6946bfc4
Headers show
Series [FFmpeg-devel,PATCH5] avcodec/codec_par: Reorder AVCodecParameters fields | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer March 4, 2024, 6:06 p.m. UTC
Move related fields closer together.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/codec_par.h | 59 +++++++++++++++++++++---------------------
 1 file changed, 29 insertions(+), 30 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/codec_par.h b/libavcodec/codec_par.h
index fa6851294f..f4b9bb5c06 100644
--- a/libavcodec/codec_par.h
+++ b/libavcodec/codec_par.h
@@ -72,6 +72,19 @@  typedef struct AVCodecParameters {
      */
     int      extradata_size;
 
+    /**
+     * Additional data associated with the entire stream.
+     *
+     * Should be allocated with av_packet_side_data_new() or
+     * av_packet_side_data_add(), and will be freed by avcodec_parameters_free().
+     */
+    AVPacketSideData *coded_side_data;
+
+    /**
+     * Amount of entries in @ref coded_side_data.
+     */
+    int nb_coded_side_data;
+
     /**
      * - video: the pixel format, the value corresponds to enum AVPixelFormat.
      * - audio: the sample format, the value corresponds to enum AVSampleFormat.
@@ -130,6 +143,18 @@  typedef struct AVCodecParameters {
      */
     AVRational sample_aspect_ratio;
 
+    /**
+     * Video only. Number of frames per second, for streams with constant frame
+     * durations. Should be set to { 0, 1 } when some frames have differing
+     * durations or if the value is not known.
+     *
+     * @note This field correponds to values that are stored in codec-level
+     * headers and is typically overridden by container/transport-layer
+     * timestamps, when available. It should thus be used only as a last resort,
+     * when no higher-level timing information is available.
+     */
+    AVRational framerate;
+
     /**
      * Video only. The order of the fields in interlaced video.
      */
@@ -149,6 +174,10 @@  typedef struct AVCodecParameters {
      */
     int video_delay;
 
+    /**
+     * Audio only. The channel layout and number of channels.
+     */
+    AVChannelLayout ch_layout;
     /**
      * Audio only. The number of audio samples per second.
      */
@@ -183,36 +212,6 @@  typedef struct AVCodecParameters {
      * Audio only. Number of samples to skip after a discontinuity.
      */
     int seek_preroll;
-
-    /**
-     * Audio only. The channel layout and number of channels.
-     */
-    AVChannelLayout ch_layout;
-
-    /**
-     * Video only. Number of frames per second, for streams with constant frame
-     * durations. Should be set to { 0, 1 } when some frames have differing
-     * durations or if the value is not known.
-     *
-     * @note This field correponds to values that are stored in codec-level
-     * headers and is typically overridden by container/transport-layer
-     * timestamps, when available. It should thus be used only as a last resort,
-     * when no higher-level timing information is available.
-     */
-    AVRational framerate;
-
-    /**
-     * Additional data associated with the entire stream.
-     *
-     * Should be allocated with av_packet_side_data_new() or
-     * av_packet_side_data_add(), and will be freed by avcodec_parameters_free().
-     */
-    AVPacketSideData *coded_side_data;
-
-    /**
-     * Amount of entries in @ref coded_side_data.
-     */
-    int nb_coded_side_data;
 } AVCodecParameters;
 
 /**