mirror of https://git.ffmpeg.org/ffmpeg.git
matroskaenc: base default duration on avg_frame_rate if possible.
Fixed Ticket432 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
0e55902324
commit
ea83b032af
|
@ -574,6 +574,9 @@ static int mkv_write_tracks(AVFormatContext *s)
|
||||||
switch (codec->codec_type) {
|
switch (codec->codec_type) {
|
||||||
case AVMEDIA_TYPE_VIDEO:
|
case AVMEDIA_TYPE_VIDEO:
|
||||||
put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_VIDEO);
|
put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_VIDEO);
|
||||||
|
if(st->avg_frame_rate.num && st->avg_frame_rate.den && 1.0/av_q2d(st->avg_frame_rate) > av_q2d(codec->time_base))
|
||||||
|
put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, 1E9/av_q2d(st->avg_frame_rate));
|
||||||
|
else
|
||||||
put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, av_q2d(codec->time_base)*1E9);
|
put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, av_q2d(codec->time_base)*1E9);
|
||||||
|
|
||||||
if (!native_id &&
|
if (!native_id &&
|
||||||
|
|
Loading…
Reference in New Issue