Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
myrsloik committed Apr 2, 2024
1 parent 3558032 commit 92bf80a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/audiosource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ bool LWAudioDecoder::DecodeNextFrame(bool SkipOutput) {
return true;
} else if (Ret == AVERROR(EAGAIN)) {
if (ReadPacket()) {
int SendRet = avcodec_send_packet(CodecContext, Packet);
assert(SendRet != AVERROR(EAGAIN));
avcodec_send_packet(CodecContext, Packet);
av_packet_unref(Packet);
} else {
avcodec_send_packet(CodecContext, nullptr);
Expand Down Expand Up @@ -376,7 +375,7 @@ BestAudioFrame *BestAudioSource::Cache::GetFrame(int64_t N) {
}

BestAudioSource::BestAudioSource(const std::string &SourceFile, int Track, int AjustDelay, bool VariableFormat, int Threads, const std::string &CachePath, const std::map<std::string, std::string> *LAVFOpts, double DrcScale, const ProgressFunction &Progress)
: Source(SourceFile), AudioTrack(Track), VariableFormat(VariableFormat), Threads(Threads), DrcScale(DrcScale) {
: Source(SourceFile), AudioTrack(Track), VariableFormat(VariableFormat), DrcScale(DrcScale), Threads(Threads) {
if (LAVFOpts)
LAVFOptions = *LAVFOpts;

Expand Down Expand Up @@ -764,7 +763,6 @@ BestAudioFrame *BestAudioSource::GetFrameLinearInternal(int64_t N, int64_t SeekF

while (Decoder && Decoder->GetFrameNumber() <= N && Decoder->HasMoreFrames()) {
int64_t FrameNumber = Decoder->GetFrameNumber();
int64_t SamplePos = Decoder->GetSamplePos();
if (FrameNumber >= N - PreRoll) {
AVFrame *Frame = Decoder->GetNextFrame();

Expand Down Expand Up @@ -1041,7 +1039,7 @@ bool BestAudioSource::WriteAudioTrackIndex(const std::string &CachePath) {
if (!F)
return false;
WriteBSHeader(F, false);
WriteInt64(F, GetFileSize(Source));
WriteInt64(F, FileSize);
WriteInt(F, AudioTrack);
WriteInt(F, VariableFormat);
WriteDouble(F, DrcScale);
Expand Down
3 changes: 1 addition & 2 deletions src/videosource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ bool LWVideoDecoder::DecodeNextFrame(bool SkipOutput) {
return true;
} else if (Ret == AVERROR(EAGAIN)) {
if (ReadPacket()) {
int SendRet = avcodec_send_packet(CodecContext, Packet);
assert(SendRet != AVERROR(EAGAIN));
avcodec_send_packet(CodecContext, Packet);
av_packet_unref(Packet);
} else {
avcodec_send_packet(CodecContext, nullptr);
Expand Down

0 comments on commit 92bf80a

Please sign in to comment.