+ /* Sometimes we get an empty AVSubtitle, which is used by some codecs to
+ indicate that the previous subtitle should stop. Emit the pending one.
+ */
+ if (_pending_subtitle_from && _pending_subtitle_image && _pending_subtitle_rect) {
+ image_subtitle (
+ ContentTimePeriod (_pending_subtitle_from.get(), period.from),
+ _pending_subtitle_image,
+ _pending_subtitle_rect.get ()
+ );
+ _pending_subtitle_from = optional<ContentTime> ();
+ _pending_subtitle_image.reset ();
+ _pending_subtitle_rect = optional<dcpomatic::Rect<double> > ();
+ }