summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-13 11:48:52 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-13 11:48:52 +0100
commit1b3e9b80e4940ccf218062fd5dc907c6079ba249 (patch)
treeb9b597e4c4f41b9c05c36d8f739bc5792ae57528 /src
parent842664b841683949bc7c6a84b4adde812d6e150e (diff)
Another attempt to fix back / same-frame seeks.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ffmpeg_content.cc2
-rw-r--r--src/lib/video_decoder.h5
-rw-r--r--src/wx/film_viewer.cc12
3 files changed, 7 insertions, 12 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index f4e1b9e72..bacc3183c 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -300,7 +300,7 @@ FFmpegAudioStream::FFmpegAudioStream (shared_ptr<const cxml::Node> node)
frame_rate = node->number_child<int> ("FrameRate");
channels = node->number_child<int64_t> ("Channels");
mapping = AudioMapping (node->node_child ("Mapping"));
- first_audio = node->optional_number_child<Time> ("FirstAudio");
+ first_audio = node->optional_number_child<double> ("FirstAudio");
}
void
diff --git a/src/lib/video_decoder.h b/src/lib/video_decoder.h
index 0b3350472..0560cbb6f 100644
--- a/src/lib/video_decoder.h
+++ b/src/lib/video_decoder.h
@@ -30,7 +30,10 @@ class VideoDecoder : public virtual Decoder
public:
VideoDecoder (boost::shared_ptr<const Film>);
- virtual void seek (VideoContent::Frame, bool) = 0;
+ /** Seek so that the next pass() will yield (approximately) the requested frame.
+ * Pass accurate = true to try harder to get close to the request.
+ */
+ virtual void seek (VideoContent::Frame frame, bool accurate) = 0;
/** Emitted when a video frame is ready.
* First parameter is the video image.
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index ab53a9d15..d27386d3d 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -139,14 +139,8 @@ FilmViewer::fetch_current_frame_again ()
if (!_player) {
return;
}
-
- Time const t = _film->video_frames_to_time (1);
-
- /* This 2.5 is, in theory: 1 to get back to the same frame, 1 more
- because we are about to call fetch_next_frame(), and 0.5 for luck.
- */
- _player->seek (_player->video_position() - t * 2.5, true);
+ _player->seek (_player->video_position(), true);
fetch_next_frame ();
}
@@ -342,9 +336,7 @@ FilmViewer::back_clicked (wxCommandEvent &)
return;
}
- Time const t = _film->video_frames_to_time (1);
-
- _player->seek (_player->video_position() - t * 2.5, true);
+ _player->seek (_player->video_position() - _film->video_frames_to_time(1), true);
fetch_next_frame ();
}