summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-10 19:40:45 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-10 19:40:45 +0100
commit5c620f37c8979a645a2094aa36b9af3d4f4ef5ec (patch)
tree7fe2a2944a307fba827316fd3e496549a678db35 /src
parentb66010a281acd3e3e58ef7202bce55023fc29d7f (diff)
Various fix-ups.
Diffstat (limited to 'src')
-rw-r--r--src/lib/player.cc8
-rw-r--r--src/wx/film_editor.cc2
-rw-r--r--src/wx/film_viewer.cc11
-rw-r--r--src/wx/film_viewer.h1
4 files changed, 19 insertions, 3 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 19899f6da..c66d091cf 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -153,11 +153,11 @@ Player::seek (double t)
setup_decoders ();
_have_valid_decoders = true;
}
-
+
/* Find the decoder that contains this position */
_video_decoder = _video_decoders.begin ();
while (_video_decoder != _video_decoders.end ()) {
- double const this_length = (*_video_decoder)->video_length() / _film->video_frame_rate ();
+ double const this_length = double ((*_video_decoder)->video_length()) / _film->video_frame_rate ();
if (t < this_length) {
break;
}
@@ -179,6 +179,10 @@ Player::seek (double t)
void
Player::setup_decoders ()
{
+ _video_decoders.clear ();
+ _video_decoder = _video_decoders.end ();
+ _sndfile_decoders.clear ();
+
if (_video) {
list<shared_ptr<const VideoContent> > vc = _playlist->video ();
for (list<shared_ptr<const VideoContent> >::iterator i = vc.begin(); i != vc.end(); ++i) {
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index a197a7490..9cd10ad61 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -788,7 +788,7 @@ FilmEditor::setup_frame_rate_description ()
if (_film->video_frame_rate()) {
d << std_to_wx (FrameRateConversion (_film->video_frame_rate(), _film->dcp_frame_rate()).description);
#ifdef HAVE_SWRESAMPLE
- if (_film->audio_frame_rate() != _film->target_audio_sample_rate ()) {
+ if (_film->audio_frame_rate() && _film->audio_frame_rate() != _film->target_audio_sample_rate ()) {
d << wxString::Format (
_("Audio will be resampled from %dHz to %dHz\n"),
_film->audio_frame_rate(),
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 8fca8f370..d18083694 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -49,6 +49,7 @@ using std::cout;
using std::list;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
+using boost::weak_ptr;
using libdcp::Size;
FilmViewer::FilmViewer (shared_ptr<Film> f, wxWindow* p)
@@ -146,6 +147,7 @@ FilmViewer::set_film (shared_ptr<Film> f)
_player->Video.connect (bind (&FilmViewer::process_video, this, _1, _2, _3));
_film->Changed.connect (boost::bind (&FilmViewer::film_changed, this, _1));
+ _film->ContentChanged.connect (boost::bind (&FilmViewer::film_content_changed, this, _1, _2));
film_changed (Film::CONTENT);
film_changed (Film::FORMAT);
@@ -431,3 +433,12 @@ FilmViewer::active_jobs_changed (bool a)
_play_button->Enable (!a);
}
+void
+FilmViewer::film_content_changed (weak_ptr<Content>, int p)
+{
+ if (p == VideoContentProperty::VIDEO_LENGTH) {
+ /* Force an update to our frame */
+ wxScrollEvent ev;
+ slider_moved (ev);
+ }
+}
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h
index 0f7b142b5..0ce8a526e 100644
--- a/src/wx/film_viewer.h
+++ b/src/wx/film_viewer.h
@@ -61,6 +61,7 @@ public:
private:
void film_changed (Film::Property);
+ void film_content_changed (boost::weak_ptr<Content>, int);
void paint_panel (wxPaintEvent &);
void panel_sized (wxSizeEvent &);
void slider_moved (wxScrollEvent &);