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;
}
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) {
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(),
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)
_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);
_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);
+ }
+}
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 &);