Skip to content

Commit

Permalink
[editor/audio] Do not respawn audio decoder even when codec parameter…
Browse files Browse the repository at this point in the history
…s change after segment switch

This patch targets temporary channel layout changes in AAC audio
streams, e.g. 5.1 --> stereo --> 5.1 with a part of video in the middle
seciont removed. The goal is to allow the decoder to resume normal
operation once the codec parameters switch back to the configuration used
to initialize the decoder.
  • Loading branch information
eumagga0x2a committed May 29, 2021
1 parent 36f764d commit 4383db4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions avidemux/common/ADM_editor/src/audio/ADM_edAudioPacket.cpp
Expand Up @@ -79,6 +79,14 @@ bool ADM_edAudioTrackFromVideo::switchToNextAudioSegment(void)
codec=trk->codec;
if(codec)
{
#if 1
/* If the codec requires extradata and codec parameters have changed,
we would need to respawn the decoder. However, doing so while unable to
handle on-the-fly changes means we cannot resume normal playback after
switch to the original channel layout present at the start of playback
prior to segment switch. FIXME */
codec->resetAfterSeek();
#else
/* If the codec requires extradata, we need to respawn the decoder
to deal with a chance that codec parameters have changed. */
uint32_t eLen=0;
Expand All @@ -97,6 +105,7 @@ bool ADM_edAudioTrackFromVideo::switchToNextAudioSegment(void)
}
if(trk->codec)
trk->codec->resetAfterSeek();
#endif
}
ADM_info("Switched ok to audio segment %" PRIu32", with a ref time=%s\n",
_audioSeg,ADM_us2plain(seg->_refStartTimeUs));
Expand Down

0 comments on commit 4383db4

Please sign in to comment.