Skip to content

Commit

Permalink
Fixed deprecation: 2023-05-15 - 7d1d61cc5f5 - lavc 60 - avcodec.h
Browse files Browse the repository at this point in the history
Depreate AVCodecContext.ticks_per_frame in favor of
AVCodecContext.framerate (encoding) and
AV_CODEC_PROP_FIELDS (decoding).
nschlia committed Jun 10, 2024
1 parent 288b745 commit 455e4c1
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -4,6 +4,10 @@ Important changes in 2.16 (2024-06-XX):

* Bugfix: Closes#1072412: Fix build with FFmpeg 7.0. write_packet() now with
const buffer as of Libavformat 61+.
* Fixed deprecation: 2023-05-15 - 7d1d61cc5f5 - lavc 60 - avcodec.h
Depreate AVCodecContext.ticks_per_frame in favor of
AVCodecContext.framerate (encoding) and
AV_CODEC_PROP_FIELDS (decoding).

Important changes in 2.15 (2024-02-03):

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -35,6 +35,10 @@ To see what's been done so far, checkout the [windows](https://github.com/nschli
**New in 2.16 (2024-06-XX):**

- Bugfix: Closes [#160](https://github.com/nschlia/ffmpegfs/issues/160): Fix build with FFmpeg 7.0. [Debian Bug #1072412](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1072412). write_packet() now with const buffer as of Libavformat 61+.
- Fixed deprecation: 2023-05-15 - 7d1d61cc5f5 - lavc 60 - avcodec.h
Depreate AVCodecContext.ticks_per_frame in favor of
AVCodecContext.framerate (encoding) and
AV_CODEC_PROP_FIELDS (decoding).

**New in 2.15 (2024-02-03):**

4 changes: 2 additions & 2 deletions src/ffmpeg_compat.h
Original file line number Diff line number Diff line change
@@ -157,11 +157,11 @@
#define LAVF_WRITEPACKET_CONST (LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(61, 0, 0))

/**
* 2023-05-xx - xxxxxxxxxx - lavc 60 - avcodec.h
* 2023-05-15 - 7d1d61cc5f5 - lavc 60 - avcodec.h
* Depreate AVCodecContext.ticks_per_frame in favor of
* AVCodecContext.framerate (encoding) and
* AV_CODEC_PROP_FIELDS (decoding).
*/
//#define LAVC_DEP_TICKSPERFRAME (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 0, 0))
#define LAVC_DEP_TICKSPERFRAME (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(60, 0, 0))

#endif // FFMPEG_COMPAT_H
4 changes: 4 additions & 0 deletions src/ffmpeg_transcoder.cc
Original file line number Diff line number Diff line change
@@ -4226,6 +4226,9 @@ void FFmpeg_Transcoder::produce_audio_dts(AVPacket *pkt)
{
pkt_duration = pkt->duration;

#if !LAVC_DEP_TICKSPERFRAME
// This has probably long since been fixed in FFmpeg, so we remove this completly
// instead of replacing it with updated code.
if (m_out.m_audio.m_codec_ctx->codec_id == AV_CODEC_ID_OPUS || m_current_format->filetype() == FILETYPE_TS || m_current_format->filetype() == FILETYPE_HLS)
{
/** @todo Is this a FFmpeg bug or am I too stupid? @n
@@ -4239,6 +4242,7 @@ void FFmpeg_Transcoder::produce_audio_dts(AVPacket *pkt)
pkt->duration = pkt_duration = static_cast<int>(av_rescale(pkt_duration, static_cast<int64_t>(m_out.m_audio.m_stream->time_base.den) * m_out.m_audio.m_codec_ctx->ticks_per_frame, m_out.m_audio.m_stream->codecpar->sample_rate * static_cast<int64_t>(m_out.m_audio.m_stream->time_base.num)));
}
}
#endif
}
else
{

0 comments on commit 455e4c1

Please sign in to comment.