lavf: use AV_CODEC_PROP_FIELDS where appropriate

H.264 and mpeg12 parsers need to be adjusted at the same time to stop
using the value of AVCodecContext.ticks_per_frame, because it is not set
correctly unless the codec has been opened. Previously this would result
in both the parser and lavf seeing the same incorrect value, which would
cancel out.
Updating lavf and not the parsers would result in correct value in lavf,
but the wrong one in parsers, which would break some tests.
This commit is contained in:
Anton Khirnov
2023-05-05 15:45:42 +02:00
parent 70433abf7f
commit e930b834a9
5 changed files with 32 additions and 21 deletions

View File

@@ -23,6 +23,7 @@
#include <stdint.h>
#include "libavcodec/codec_desc.h"
#include "libavcodec/packet_internal.h"
#include "avformat.h"
@@ -408,6 +409,8 @@ typedef struct FFStream {
*/
int64_t first_dts;
int64_t cur_dts;
const AVCodecDescriptor *codec_desc;
} FFStream;
static av_always_inline FFStream *ffstream(AVStream *st)