Skip to content

Commit

Permalink
Fix:Retry transcode forcing AAC to handle the bad audible m4bs #2720
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Apr 15, 2024
1 parent 60c6500 commit 0f7c99d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/objects/Stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class Stream extends EventEmitter {
var current_chunk = []
var last_seg_in_chunk = -1

var segments = Array.from(this.segmentsCreated).sort((a, b) => a - b);
var segments = Array.from(this.segmentsCreated).sort((a, b) => a - b)
var lastSegment = segments[segments.length - 1]
if (lastSegment > this.furthestSegmentCreated) {
this.furthestSegmentCreated = lastSegment
Expand Down Expand Up @@ -342,7 +342,7 @@ class Stream extends EventEmitter {
Logger.error('Ffmpeg Err', '"' + err.message + '"')

// Temporary workaround for https://github.com/advplyr/audiobookshelf/issues/172 and https://github.com/advplyr/audiobookshelf/issues/2157
const aacErrorMsg = 'ffmpeg exited with code 1:'
const aacErrorMsg = 'ffmpeg exited with code 1'
if (audioCodec === 'copy' && this.isAACEncodable && err.message?.startsWith(aacErrorMsg)) {
Logger.info(`[Stream] Re-attempting stream with AAC encode`)
this.transcodeOptions.forceAAC = true
Expand Down

0 comments on commit 0f7c99d

Please sign in to comment.