mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
Merge commit 'eabdc2a830f1ab1a3f12243eb7e2fba801cb81f0'
* commit 'eabdc2a830f1ab1a3f12243eb7e2fba801cb81f0': lavf: use initial_padding instead of deprecated delay Conflicts: libavformat/matroskaenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
4694c0bb7c
@ -870,13 +870,14 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
|
||||
}
|
||||
}
|
||||
|
||||
if (codec->codec_type == AVMEDIA_TYPE_AUDIO && codec->delay && codec->codec_id == AV_CODEC_ID_OPUS) {
|
||||
// mkv->tracks[i].ts_offset = av_rescale_q(codec->delay,
|
||||
if (codec->codec_type == AVMEDIA_TYPE_AUDIO && codec->initial_padding && codec->codec_id == AV_CODEC_ID_OPUS) {
|
||||
// mkv->tracks[i].ts_offset = av_rescale_q(codec->initial_padding,
|
||||
// (AVRational){ 1, codec->sample_rate },
|
||||
// st->time_base);
|
||||
|
||||
put_ebml_uint(pb, MATROSKA_ID_CODECDELAY,
|
||||
av_rescale_q(codec->delay, (AVRational){ 1, codec->sample_rate },
|
||||
av_rescale_q(codec->initial_padding,
|
||||
(AVRational){ 1, codec->sample_rate },
|
||||
(AVRational){ 1, 1000000000 }));
|
||||
}
|
||||
if (codec->codec_id == AV_CODEC_ID_OPUS) {
|
||||
|
@ -582,7 +582,10 @@ static int ogg_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
|
||||
}
|
||||
granule = (oggstream->last_kf_pts<<oggstream->kfgshift) | pframe_count;
|
||||
} else if (st->codec->codec_id == AV_CODEC_ID_OPUS)
|
||||
granule = pkt->pts + pkt->duration + av_rescale_q(st->codec->delay, (AVRational){ 1, st->codec->sample_rate }, st->time_base);
|
||||
granule = pkt->pts + pkt->duration +
|
||||
av_rescale_q(st->codec->initial_padding,
|
||||
(AVRational){ 1, st->codec->sample_rate },
|
||||
st->time_base);
|
||||
else
|
||||
granule = pkt->pts + pkt->duration;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user