/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "raw_image_proxy.h"
#include "ratio.h"
#include "log.h"
-#include "scaler.h"
#include "render_subtitles.h"
#include "config.h"
#include "content_video.h"
: _film (f)
, _playlist (p)
, _have_valid_pieces (false)
- , _approximate_size (false)
, _ignore_video (false)
{
_playlist_changed_connection = _playlist->Changed.connect (bind (&Player::playlist_changed, this));
}
}
-/** @param already_resampled true if this data has already been through the chain up to the resampler */
void
Player::playlist_changed ()
{
last time we were run.
*/
- if (p == Film::SCALER || p == Film::CONTAINER || p == Film::VIDEO_FRAME_RATE) {
+ if (p == Film::CONTAINER || p == Film::VIDEO_FRAME_RATE) {
Changed (false);
}
}
PositionImage (
i->image->scale (
scaled_size,
- Scaler::from_id ("bicubic"),
+ dcp::YUV_TO_RGB_REC601,
i->image->pixel_format (),
true
),
return all;
}
-void
-Player::set_approximate_size ()
-{
- _approximate_size = true;
-}
-
shared_ptr<PlayerVideo>
Player::black_player_video_frame (DCPTime time) const
{
optional<float> (),
_video_container_size,
_video_container_size,
- Scaler::from_id ("bicubic"),
EYES_BOTH,
PART_WHOLE,
Config::instance()->colour_conversions().front().conversion
return pvf;
}
- dcp::Size image_size = content->scale().size (content, _video_container_size, _film->frame_size (), _approximate_size ? 4 : 1);
- if (_approximate_size) {
- image_size.width &= ~3;
- image_size.height &= ~3;
- }
+ dcp::Size image_size = content->scale().size (content, _video_container_size, _film->frame_size ());
for (list<ContentVideo>::const_iterator i = content_video.begin(); i != content_video.end(); ++i) {
pvf.push_back (
content->fade (i->frame),
image_size,
_video_container_size,
- _film->scaler(),
i->eyes,
i->part,
content->colour_conversion ()
/* The time that we should request from the content */
DCPTime request = time - DCPTime::from_seconds (content->audio_delay() / 1000.0);
+ AudioFrame request_frames = length_frames;
DCPTime offset;
if (request < DCPTime ()) {
/* We went off the start of the content, so we will need to offset
the stuff we get back.
*/
offset = -request;
+ request_frames += request.frames (_film->audio_frame_rate ());
+ if (request_frames < 0) {
+ request_frames = 0;
+ }
request = DCPTime ();
}
AudioFrame const content_frame = dcp_to_content_audio (*i, request);
/* Audio from this piece's decoder (which might be more or less than what we asked for) */
- shared_ptr<ContentAudio> all = decoder->get_audio (content_frame, length_frames, accurate);
+ shared_ptr<ContentAudio> all = decoder->get_audio (content_frame, request_frames, accurate);
/* Gain */
if (content->audio_gain() != 0) {
all->audio.get(),
content_frame - all->frame,
offset.frames (_film->audio_frame_rate()),
- min (AudioFrame (all->audio->frames()), length_frames) - offset.frames (_film->audio_frame_rate ())
+ min (AudioFrame (all->audio->frames()), request_frames)
);
}