diff --git a/aegisub/src/audio_controller.cpp b/aegisub/src/audio_controller.cpp index 6322e90c9..4e7480f00 100644 --- a/aegisub/src/audio_controller.cpp +++ b/aegisub/src/audio_controller.cpp @@ -77,6 +77,12 @@ AudioController::AudioController(agi::Context *context) OPT_SUB("Audio/Player", &AudioController::OnAudioPlayerChanged, this); OPT_SUB("Audio/Provider", &AudioController::OnAudioProviderChanged, this); OPT_SUB("Audio/Cache/Type", &AudioController::OnAudioProviderChanged, this); + +#ifdef WITH_FFMS2 + // As with the video ones, it'd be nice to figure out a decent way to move + // this to the provider itself + OPT_SUB("Provider/Audio/FFmpegSource/Decode Error Handling", &AudioController::OnAudioProviderChanged, this); +#endif } diff --git a/aegisub/src/audio_provider_ffmpegsource.cpp b/aegisub/src/audio_provider_ffmpegsource.cpp index 56c45b7f3..63f04be8d 100644 --- a/aegisub/src/audio_provider_ffmpegsource.cpp +++ b/aegisub/src/audio_provider_ffmpegsource.cpp @@ -122,6 +122,13 @@ void FFmpegSourceAudioProvider::LoadAudio(wxString filename) { TrackNumber = FFMS_TRACKMASK_ALL; // else: do nothing (keep track mask as it is) + // reindex if the error handling mode has changed + FFMS_IndexErrorHandling ErrorHandling = GetErrorHandlingMode(); +#if FFMS_VERSION >= ((2 << 24) | (17 << 16) | (2 << 8) | 0) + if (Index && FFMS_GetErrorHandling(Index) != ErrorHandling) + Index = NULL; +#endif + // moment of truth if (!Index) { int TrackMask; @@ -130,7 +137,7 @@ void FFmpegSourceAudioProvider::LoadAudio(wxString filename) { else TrackMask = (1 << TrackNumber); - Index = DoIndexing(Indexer, CacheName, TrackMask, GetErrorHandlingMode()); + Index = DoIndexing(Indexer, CacheName, TrackMask, ErrorHandling); // if tracknumber still isn't set we need to set it now if (TrackNumber == FFMS_TRACKMASK_ALL)