[FFmpeg-devel] [PATCH] avformat/matroskaenc: use r_frame_rate as fallback to set a track's DefaultDuration

James Almer jamrial at gmail.com
Sun Oct 6 19:46:14 EEST 2019


On 10/1/2019 12:58 PM, James Almer wrote:
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavformat/matroskaenc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index a64ffdb690..37706e56c7 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -1311,6 +1311,9 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
>          if(   st->avg_frame_rate.num > 0 && st->avg_frame_rate.den > 0
>             && av_cmp_q(av_inv_q(st->avg_frame_rate), st->time_base) > 0)
>              put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, 1000000000LL * st->avg_frame_rate.den / st->avg_frame_rate.num);
> +        else if(   st->r_frame_rate.num > 0 && st->r_frame_rate.den > 0
> +                && av_cmp_q(av_inv_q(st->r_frame_rate), st->time_base) > 0)
> +            put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, 1000000000LL * st->r_frame_rate.den / st->r_frame_rate.num);
>  
>          if (!native_id &&
>              ff_codec_get_tag(ff_codec_movvideo_tags, par->codec_id) &&

Pushed.


More information about the ffmpeg-devel mailing list