Skip to content

Commit

Permalink
Unrelated logging improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 3, 2025
1 parent 74817c7 commit 083543c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Core/HLE/sceAtrac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ static int sceAtracLowLevelInitDecoder(int atracID, u32 paramsAddr) {
}
}
if (!found) {
ERROR_LOG_REPORT(Log::ME, "AT3 header map lacks entry for bpf: %i channels: %i", atrac->GetTrack().BytesPerFrame(), atrac->GetTrack().channels);
WARN_LOG_REPORT_ONCE(at3headermap, Log::ME, "AT3 header map lacks entry for bpf: %i channels: %i", atrac->GetTrack().BytesPerFrame(), atrac->GetTrack().channels);
// TODO: Should we return an error code for these values?
}
}
Expand Down
10 changes: 6 additions & 4 deletions ext/at3_standalone/atrac3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,13 +577,15 @@ static int decode_channel_sound_unit(ATRAC3Context *q, GetBitContext *gb,
GainBlock *gain2 = &snd->gain_block[1 - snd->gc_blk_switch];

if (coding_mode == JOINT_STEREO && channel_num == 1) {
if (get_bits(gb, 2) != 3) {
av_log(AV_LOG_ERROR,"JS mono Sound Unit id != 3.");
int bits = get_bits(gb, 2);
if (bits != 3) {
av_log(AV_LOG_ERROR,"Joint Stereo mono Sound Unit id %d != 3.", bits);
return AVERROR_INVALIDDATA;
}
} else {
if (get_bits(gb, 6) != 0x28) {
av_log(AV_LOG_ERROR,"Sound Unit id != 0x28.");
int bits = get_bits(gb, 6);
if (bits != 0x28) {
av_log(AV_LOG_ERROR, "Sound Unit id %02x != 0x28.", bits);
return AVERROR_INVALIDDATA;
}
}
Expand Down

0 comments on commit 083543c

Please sign in to comment.