mirror of
https://github.com/librempeg/librempeg
synced 2024-11-21 16:44:05 +00:00
lavd: use AVFrame.duration instead of AVFrame.pkt_duration
This commit is contained in:
parent
7d9ee6741c
commit
2d90fc89f2
@ -131,7 +131,14 @@ static int audio_write_frame(AVFormatContext *s1, int stream_index,
|
||||
pkt.data = (*frame)->data[0];
|
||||
pkt.size = (*frame)->nb_samples * s->frame_size;
|
||||
pkt.dts = (*frame)->pkt_dts;
|
||||
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;
|
||||
return audio_write_packet(s1, &pkt);
|
||||
}
|
||||
|
||||
|
@ -686,7 +686,14 @@ static int pulse_write_frame(AVFormatContext *h, int stream_index,
|
||||
pkt.data = (*frame)->data[0];
|
||||
pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * (*frame)->ch_layout.nb_channels;
|
||||
pkt.dts = (*frame)->pkt_dts;
|
||||
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;
|
||||
return pulse_write_packet(h, &pkt);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user