diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-05-22 14:57:56 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-05-22 14:57:56 +0100 |
| commit | d342a1befa88cb3f23c7e3fccfd1edaeea968fed (patch) | |
| tree | f566fa87d0de35f3f0c4d7e20752c83b8a5b9bce /src/lib/ffmpeg_decoder.cc | |
| parent | 85d343a420c4df1a08663c8afd3bdb73c8dfa985 (diff) | |
Add ContentTimePeriod class.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 9548eaae9..eec70501a 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -535,7 +535,7 @@ FFmpegDecoder::decode_subtitle_packet () indicate that the previous subtitle should stop. */ if (sub.num_rects <= 0) { - image_subtitle (ContentTime (), ContentTime (), shared_ptr<Image> (), dcpomatic::Rect<double> ()); + image_subtitle (ContentTimePeriod (), shared_ptr<Image> (), dcpomatic::Rect<double> ()); return; } else if (sub.num_rects > 1) { throw DecodeError (_("multi-part subtitles not yet supported")); @@ -545,10 +545,11 @@ FFmpegDecoder::decode_subtitle_packet () source that we may have chopped off for the DCP) */ ContentTime packet_time = ContentTime::from_seconds (static_cast<double> (sub.pts) / AV_TIME_BASE) + _pts_offset; - - /* hence start time for this sub */ - ContentTime const from = packet_time + ContentTime::from_seconds (sub.start_display_time / 1e3); - ContentTime const to = packet_time + ContentTime::from_seconds (sub.end_display_time / 1e3); + + ContentTimePeriod period ( + packet_time + ContentTime::from_seconds (sub.start_display_time / 1e3), + packet_time + ContentTime::from_seconds (sub.end_display_time / 1e3) + ); AVSubtitleRect const * rect = sub.rects[0]; @@ -586,8 +587,7 @@ FFmpegDecoder::decode_subtitle_packet () dcp::Size const vs = _ffmpeg_content->video_size (); image_subtitle ( - from, - to, + period, image, dcpomatic::Rect<double> ( static_cast<double> (rect->x) / vs.width, |
