if (content->trimmed (relative_time)) {
return;
}
-
- shared_ptr<Image> work_image = image->crop (content->crop(), true);
+
+ /* Convert to RGB first, as FFmpeg doesn't seem to like handling YUV images with odd widths */
+ shared_ptr<Image> work_image = image->scale (image->size (), _film->scaler(), PIX_FMT_RGB24, true);
+
+ work_image = work_image->crop (content->crop(), true);
libdcp::Size const image_size = content->ratio()->size (_video_container_size);
- work_image = work_image->scale_and_convert_to_rgb (image_size, _film->scaler(), true);
+ work_image = work_image->scale (image_size, _film->scaler(), PIX_FMT_RGB24, true);
Time time = content->position() + relative_time - content->trim_start ();
shared_ptr<AudioContent> content = dynamic_pointer_cast<AudioContent> (piece->content);
assert (content);
+ /* Gain */
+ if (content->audio_gain() != 0) {
+ shared_ptr<AudioBuffers> gain (new AudioBuffers (audio));
+ gain->apply_gain (content->audio_gain ());
+ audio = gain;
+ }
+
/* Resample */
if (content->content_audio_frame_rate() != content->output_audio_frame_rate()) {
shared_ptr<Resampler> r = resampler (content, true);
void
Player::emit_silence (OutputAudioFrame most)
{
+ if (most == 0) {
+ return;
+ }
+
OutputAudioFrame N = min (most, _film->audio_frame_rate() / 2);
shared_ptr<AudioBuffers> silence (new AudioBuffers (_film->audio_channels(), N));
silence->make_silent ();
_out_subtitle.position.x = rint (_video_container_size.width * (in_rect.x + (in_rect.width * (1 - sc->subtitle_scale ()) / 2)));
_out_subtitle.position.y = rint (_video_container_size.height * (in_rect.y + (in_rect.height * (1 - sc->subtitle_scale ()) / 2)));
- _out_subtitle.image = _in_subtitle.image->scale (libdcp::Size (scaled_size.width, scaled_size.height), Scaler::from_id ("bicubic"), true);
+ _out_subtitle.image = _in_subtitle.image->scale (
+ scaled_size,
+ Scaler::from_id ("bicubic"),
+ _in_subtitle.image->pixel_format (),
+ true
+ );
_out_subtitle.from = _in_subtitle.from + piece->content->position ();
_out_subtitle.to = _in_subtitle.to + piece->content->position ();
}