diff --git a/plugins/actions/timingfromplayer/timingfromplayer.cc b/plugins/actions/timingfromplayer/timingfromplayer.cc index 22992035..7fe8c547 100644 --- a/plugins/actions/timingfromplayer/timingfromplayer.cc +++ b/plugins/actions/timingfromplayer/timingfromplayer.cc @@ -269,15 +269,20 @@ class TimingFromPlayer : public Action { if (player->get_state() == Player::PLAYING) pos = pos - get_prefered_offset(); - SubtitleTime dur = sub.get_duration(); - // Start recording doc->start_command(get_command_name_from_option(op)); if (op & SET_SUBTITLE_START) { // Define the start of the subtitle from the // video position, we keep the duration - sub.set_start_and_end(pos, pos + dur); + std::vector selection = doc->subtitles().get_selection(); + std::vector::iterator it = selection.begin(); + std::vector::iterator eit = selection.end(); + SubtitleTime diff = pos - it->get_start(); + while( it != eit ) { + it->set_start_and_end(it->get_start()+diff, it->get_end()+diff); + ++it; + } } else if (op & SET_SUBTITLE_END) { sub.set_end(pos); }