diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-07-11 10:31:47 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-07-19 12:27:17 +0200 |
commit | 7d9ee6741c53a2ea9f3a5559c32320b731a8d80a (patch) | |
tree | b54af9f1463c34625cbddcbb74443557abb1cf66 /libavformat | |
parent | 357ba45a5ca3864b0eba07747ab6ea1614f2646b (diff) | |
download | ffmpeg-7d9ee6741c53a2ea9f3a5559c32320b731a8d80a.tar.gz |
lavf: use AVFrame.duration instead of AVFrame.pkt_duration
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mux.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c index 31361f9b46..a3b50dadb6 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -1417,7 +1417,14 @@ static int write_uncoded_frame_internal(AVFormatContext *s, int stream_index, pkt->size = sizeof(frame); pkt->pts = pkt->dts = frame->pts; - pkt->duration = frame->pkt_duration; +#if FF_API_PKT_DURATION +FF_DISABLE_DEPRECATION_WARNINGS + if (frame->pkt_duration) + pkt->duration = frame->pkt_duration; + else +FF_ENABLE_DEPRECATION_WARNINGS +#endif + pkt->duration = frame->duration; pkt->stream_index = stream_index; pkt->flags |= AV_PKT_FLAG_UNCODED_FRAME; } |