Make emit_bitmap_start take a ContentBitmapText.
authorCarl Hetherington <cth@carlh.net>
Thu, 28 Apr 2022 07:47:22 +0000 (09:47 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 28 Apr 2022 07:47:22 +0000 (09:47 +0200)
src/lib/ffmpeg_decoder.cc
src/lib/text_decoder.cc
src/lib/text_decoder.h

index 30a4b1823e8873193051ec2c6e91f9bbfe68f4c8..f76c7699e3901d5dbcbdb1d48517438f06dd4ba8 100644 (file)
@@ -754,7 +754,7 @@ FFmpegDecoder::process_bitmap_subtitle (AVSubtitleRect const * rect, ContentTime
                static_cast<double>(rect->h) / target_height
                );
 
-       only_text()->emit_bitmap_start (from, image, scaled_rect);
+       only_text()->emit_bitmap_start ({ from, image, scaled_rect });
 }
 
 
index 99b68faba2b8ae570d7a60cc1cf28f4d67565923..d5afb555d6683e84daa13c4fe36cfd53151e3b14 100644 (file)
@@ -60,10 +60,10 @@ TextDecoder::TextDecoder (
  *  of the video frame)
  */
 void
-TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr<const Image> image, dcpomatic::Rect<double> rect)
+TextDecoder::emit_bitmap_start (ContentBitmapText const& bitmap)
 {
-       BitmapStart (ContentBitmapText (from, image, rect));
-       _position = from;
+       BitmapStart (bitmap);
+       _position = bitmap.from();
 }
 
 
@@ -288,7 +288,7 @@ TextDecoder::emit_plain (ContentTimePeriod period, sub::Subtitle const & s)
 void
 TextDecoder::emit_bitmap (ContentTimePeriod period, shared_ptr<const Image> image, dcpomatic::Rect<double> rect)
 {
-       emit_bitmap_start (period.from, image, rect);
+       emit_bitmap_start ({ period.from, image, rect });
        emit_stop (period.to);
 }
 
index 39d6e828d97864552e5833b9dad9bae3028aa363..96b335de14397ac1c9644ad4feb7dd3e150ee615 100644 (file)
@@ -52,7 +52,7 @@ public:
                return _position;
        }
 
-       void emit_bitmap_start (dcpomatic::ContentTime from, std::shared_ptr<const Image> image, dcpomatic::Rect<double> rect);
+       void emit_bitmap_start (ContentBitmapText const& bitmap);
        void emit_bitmap (dcpomatic::ContentTimePeriod period, std::shared_ptr<const Image> image, dcpomatic::Rect<double> rect);
        void emit_plain_start (dcpomatic::ContentTime from, std::list<dcp::SubtitleString> s);
        void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle);