_playlist_changed_connection = _playlist->Changed.connect (bind (&Player::playlist_changed, this));
_playlist_content_changed_connection = _playlist->ContentChanged.connect (bind (&Player::content_changed, this, _1, _2, _3));
_film_changed_connection = _film->Changed.connect (bind (&Player::film_changed, this, _1));
- set_video_container_size (fit_ratio_within (_film->container()->ratio (), _film->full_frame ()));
+ set_video_container_size (_film->frame_size ());
}
void
break;
}
-
dec->set_dcp_times ((*i)->frc, offset);
DCPTime const t = dec->dcp_time - offset;
- cout << "Peeked " << (*i)->content->paths()[0] << " for " << t << " cf " << ((*i)->content->full_length() - (*i)->content->trim_end ()) << "\n";
if (t >= ((*i)->content->full_length() - (*i)->content->trim_end ())) {
/* In the end-trimmed part; decoder has nothing else to give us */
dec.reset ();
if (earliest_audio.get() < 0) {
earliest_audio = DCPTime ();
}
- TimedAudioBuffers<DCPTime> tb = _audio_merger.pull (earliest_audio);
+ TimedAudioBuffers tb = _audio_merger.pull (earliest_audio);
Audio (tb.audio, tb.time);
/* This assumes that the audio-frames-to-time conversion is exact
so that there are no accumulated errors caused by rounding.
void
Player::flush ()
{
- TimedAudioBuffers<DCPTime> tb = _audio_merger.flush ();
+ TimedAudioBuffers tb = _audio_merger.flush ();
if (_audio && tb.audio) {
Audio (tb.audio, tb.time);
_audio_position += DCPTime::from_frames (tb.audio->frames (), _film->audio_frame_rate ());
/* FFmpeg */
shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (*i);
if (fc) {
- decoder.reset (new FFmpegDecoder (_film, fc, _video, _audio));
+ decoder.reset (new FFmpegDecoder (fc, _film->log(), _video, _audio, _film->with_subtitles ()));
frc = FrameRateChange (fc->video_frame_rate(), _film->video_frame_rate());
}
}
if (!decoder) {
- decoder.reset (new ImageDecoder (_film, ic));
+ decoder.reset (new ImageDecoder (ic));
}
frc = FrameRateChange (ic->video_frame_rate(), _film->video_frame_rate());
/* SndfileContent */
shared_ptr<const SndfileContent> sc = dynamic_pointer_cast<const SndfileContent> (*i);
if (sc) {
- decoder.reset (new SndfileDecoder (_film, sc));
+ decoder.reset (new SndfileDecoder (sc));
frc = best_overlap_frc;
}
/* SubRipContent */
shared_ptr<const SubRipContent> rc = dynamic_pointer_cast<const SubRipContent> (*i);
if (rc) {
- decoder.reset (new SubRipDecoder (_film, rc));
+ decoder.reset (new SubRipDecoder (rc));
frc = best_overlap_frc;
}
void
Player::emit_silence (DCPTime most)
{
- if (most == 0) {
+ if (most == DCPTime ()) {
return;
}
PlayerStatistics::dump (shared_ptr<Log> log) const
{
log->log (String::compose ("Video: %1 good %2 skipped %3 black %4 repeat", video.good, video.skip, video.black, video.repeat));
- log->log (String::compose ("Audio: %1 good %2 skipped %3 silence", audio.good, audio.skip, audio.silence));
+ log->log (String::compose ("Audio: %1 good %2 skipped %3 silence", audio.good, audio.skip, audio.silence.seconds()));
}
PlayerStatistics const &