Skip to content

Commit da05a71

Browse files
committed
Fix deprecated warnings into encoder classes
1 parent f96989b commit da05a71

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

src/AvTranscoder/encoder/AudioEncoder.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,18 @@ bool AudioEncoder::encodeFrame(const IFrame& sourceFrame, CodedData& codedFrame)
9696
AVCodecContext& avCodecContext = _codec.getAVCodecContext();
9797

9898
AVPacket& packet = codedFrame.getAVPacket();
99-
if((avCodecContext.coded_frame) && (avCodecContext.coded_frame->pts != (int)AV_NOPTS_VALUE))
99+
const AVFrame& srcAvFrame = sourceFrame.getAVFrame();
100+
if(srcAvFrame.pts != (int)AV_NOPTS_VALUE)
100101
{
101-
packet.pts = avCodecContext.coded_frame->pts;
102+
packet.pts = srcAvFrame.pts;
102103
}
103104

104-
if(avCodecContext.coded_frame && avCodecContext.coded_frame->key_frame)
105+
if(srcAvFrame.key_frame)
105106
{
106107
packet.flags |= AV_PKT_FLAG_KEY;
107108
}
108109

109-
return encode(&sourceFrame.getAVFrame(), packet);
110+
return encode(&srcAvFrame, packet);
110111
}
111112

112113
bool AudioEncoder::encodeFrame(CodedData& codedFrame)

src/AvTranscoder/encoder/AudioEncoder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef _AV_TRANSCODER_ENCODER_AUDIO_ENCODER_HPP_
22
#define _AV_TRANSCODER_ENCODER_AUDIO_ENCODER_HPP_
33

4-
#include "IEncoder.hpp"
4+
#include <AvTranscoder/encoder/IEncoder.hpp>
55
#include <AvTranscoder/codec/AudioCodec.hpp>
66
#include <AvTranscoder/profile/ProfileLoader.hpp>
77

src/AvTranscoder/encoder/VideoEncoder.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,18 @@ bool VideoEncoder::encodeFrame(const IFrame& sourceFrame, CodedData& codedFrame)
113113
AVCodecContext& avCodecContext = _codec.getAVCodecContext();
114114

115115
AVPacket& packet = codedFrame.getAVPacket();
116-
if((avCodecContext.coded_frame) && (avCodecContext.coded_frame->pts != (int)AV_NOPTS_VALUE))
116+
const AVFrame& srcAvFrame = sourceFrame.getAVFrame();
117+
if(srcAvFrame.pts != (int)AV_NOPTS_VALUE)
117118
{
118-
packet.pts = avCodecContext.coded_frame->pts;
119+
packet.pts = srcAvFrame.pts;
119120
}
120121

121-
if(avCodecContext.coded_frame && avCodecContext.coded_frame->key_frame)
122+
if(srcAvFrame.key_frame)
122123
{
123124
packet.flags |= AV_PKT_FLAG_KEY;
124125
}
125126

126-
return encode(&sourceFrame.getAVFrame(), packet);
127+
return encode(&srcAvFrame, packet);
127128
}
128129

129130
bool VideoEncoder::encodeFrame(CodedData& codedFrame)

src/AvTranscoder/encoder/VideoEncoder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef _AV_TRANSCODER_ENCODER_VIDEO_ENCODER_HPP_
22
#define _AV_TRANSCODER_ENCODER_VIDEO_ENCODER_HPP_
33

4-
#include "IEncoder.hpp"
4+
#include <AvTranscoder/encoder/IEncoder.hpp>
55
#include <AvTranscoder/codec/VideoCodec.hpp>
66
#include <AvTranscoder/profile/ProfileLoader.hpp>
77

0 commit comments

Comments
 (0)