diff --git a/aegisub/src/video_box.cpp b/aegisub/src/video_box.cpp index 5da7f3f32..0c2d9e3c0 100644 --- a/aegisub/src/video_box.cpp +++ b/aegisub/src/video_box.cpp @@ -143,9 +143,6 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context) UpdateTimeBoxes(); - Bind(wxEVT_COMMAND_BUTTON_CLICKED, &VideoBox::OnButton, this); - Bind(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, &VideoBox::OnButton, this); - slots.push_back(context->videoController->AddSeekListener(&VideoBox::UpdateTimeBoxes, this)); slots.push_back(context->videoController->AddKeyframesListener(&VideoBox::UpdateTimeBoxes, this)); slots.push_back(context->videoController->AddTimecodesListener(&VideoBox::UpdateTimeBoxes, this)); @@ -159,11 +156,6 @@ VideoBox::~VideoBox() { context->selectionController->RemoveSelectionListener(this); } -void VideoBox::OnButton(wxCommandEvent &evt) { - context->videoController->EnableAudioSync(!wxGetMouseState().CmdDown()); - evt.Skip(); -} - void VideoBox::UpdateTimeBoxes() { if (!context->videoController->IsLoaded()) return; diff --git a/aegisub/src/video_box.h b/aegisub/src/video_box.h index d570f3ea5..c55846c28 100644 --- a/aegisub/src/video_box.h +++ b/aegisub/src/video_box.h @@ -67,9 +67,6 @@ class VideoBox : public wxPanel, private SelectionListener { wxTextCtrl *VideoSubsPos; ///< Time relative to the active subtitle line wxComboBox *zoomBox; - /// Handle a click on the play/pause buttons - void OnButton(wxCommandEvent &evt); - /// Update VideoPosition and VideoSubsPos void UpdateTimeBoxes(); diff --git a/aegisub/src/video_context.cpp b/aegisub/src/video_context.cpp index b27d8bfe8..7fa03d33d 100644 --- a/aegisub/src/video_context.cpp +++ b/aegisub/src/video_context.cpp @@ -75,7 +75,6 @@ VideoContext::VideoContext() , startMS(0) , endFrame(0) , nextFrame(-1) -, keepAudioSync(true) , frame_n(0) , arValue(1.) , arType(0) @@ -431,26 +430,10 @@ void VideoContext::OnPlayTimer(wxTimerEvent &) { return; } - - // Next frame is before or over 2 frames ahead, so force audio resync - if (context->audioController->IsPlaying() && keepAudioSync && (nextFrame < frame_n || nextFrame > frame_n + 2)) { - context->audioController->ResyncPlaybackPosition(context->audioController->SamplesFromMilliseconds(TimeAtFrame(nextFrame))); - } - // Jump to next frame frame_n = nextFrame; GetFrameAsync(frame_n); Seek(frame_n); - - // Sync audio - if (keepAudioSync && nextFrame % 10 == 0 && context->audioController->IsPlaying()) { - int64_t audPos = context->audioController->SamplesFromMilliseconds(TimeAtFrame(nextFrame)); - int64_t curPos = context->audioController->GetPlaybackPosition(); - int delta = int(audPos-curPos); - if (delta < 0) delta = -delta; - int maxDelta = context->audioController->SamplesFromMilliseconds(1000); - if (delta > maxDelta) context->audioController->ResyncPlaybackPosition(audPos); - } } double VideoContext::GetARFromType(int type) const { diff --git a/aegisub/src/video_context.h b/aegisub/src/video_context.h index 478ad3ba9..572b57be6 100644 --- a/aegisub/src/video_context.h +++ b/aegisub/src/video_context.h @@ -107,9 +107,6 @@ class VideoContext : public wxEvtHandler { /// DOCME int nextFrame; - /// DOCME - bool keepAudioSync; - /// DOCME int frame_n; @@ -174,11 +171,6 @@ public: /// @brief Does the video file loaded have muxed subtitles that we can load? bool HasSubtitles() const { return hasSubtitles; } - /// @brief DOCME - /// @param sync - /// @return - void EnableAudioSync(bool sync = true) { keepAudioSync = sync; } - /// @brief Get the width of the currently open video int GetWidth() const;