It is the most commonly used field and moving it to the start e.g. allows to encode the offset in a pointer+offset addressing mode on one byte on x86.
Unified · Split
| @@ -962,6 +962,17 @@ typedef struct AVStream { · 961 unmodified lines | ||
| 962 | 962 | */ |
| 963 | 963 | int id; |
| 964 | 964 | |
| 965 | + /** | |
| 966 | + * Codec parameters associated with this stream. Allocated and freed by | |
| 967 | + * libavformat in avformat_new_stream() and avformat_free_context() | |
| 968 | + * respectively. | |
| 969 | + * | |
| 970 | + * - demuxing: filled by libavformat on stream creation or in | |
| 971 | + * avformat_find_stream_info() | |
| 972 | + * - muxing: filled by the caller before avformat_write_header() | |
| 973 | + */ | |
| 974 | + AVCodecParameters *codecpar; | |
| 975 | + | |
| 965 | 976 | void *priv_data; |
| 966 | 977 | |
| 967 | 978 | /** |
| @@ -1097,17 +1108,6 @@ typedef struct AVStream { · 129 unmodified lines | ||
| 1097 | 1108 | */ |
| 1098 | 1109 | AVRational r_frame_rate; |
| 1099 | 1110 | |
| 1100 | − /** | |
| 1101 | − * Codec parameters associated with this stream. Allocated and freed by | |
| 1102 | − * libavformat in avformat_new_stream() and avformat_free_context() | |
| 1103 | − * respectively. | |
| 1104 | − * | |
| 1105 | − * - demuxing: filled by libavformat on stream creation or in | |
| 1106 | − * avformat_find_stream_info() | |
| 1107 | − * - muxing: filled by the caller before avformat_write_header() | |
| 1108 | − */ | |
| 1109 | − AVCodecParameters *codecpar; | |
| 1110 | − | |
| 1111 | 1111 | /** |
| 1112 | 1112 | * Number of bits in timestamps. Used for wrapping control. |
| 1113 | 1113 | * |