C++11 tidying.
authorCarl Hetherington <cth@carlh.net>
Thu, 15 Jul 2021 12:08:56 +0000 (14:08 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 15 Jul 2021 12:08:56 +0000 (14:08 +0200)
src/lib/dcp_decoder.cc
src/lib/ffmpeg_encoder.cc
src/lib/ffmpeg_file_encoder.cc

index 9de63dc..59b44ae 100644 (file)
@@ -160,41 +160,35 @@ DCPDecoder::pass ()
                if (_mono_reader) {
                        video->emit (
                                film(),
                if (_mono_reader) {
                        video->emit (
                                film(),
-                               shared_ptr<ImageProxy> (
-                                       new J2KImageProxy (
-                                               _mono_reader->get_frame (entry_point + frame),
-                                               picture_asset->size(),
-                                               AV_PIX_FMT_XYZ12LE,
-                                               _forced_reduction
-                                               )
+                               std::make_shared<J2KImageProxy>(
+                                       _mono_reader->get_frame (entry_point + frame),
+                                       picture_asset->size(),
+                                       AV_PIX_FMT_XYZ12LE,
+                                       _forced_reduction
                                        ),
                                _offset + frame
                                );
                } else {
                        video->emit (
                                film(),
                                        ),
                                _offset + frame
                                );
                } else {
                        video->emit (
                                film(),
-                               shared_ptr<ImageProxy> (
-                                       new J2KImageProxy (
-                                               _stereo_reader->get_frame (entry_point + frame),
-                                               picture_asset->size(),
-                                               dcp::Eye::LEFT,
-                                               AV_PIX_FMT_XYZ12LE,
-                                               _forced_reduction
-                                               )
+                               std::make_shared<J2KImageProxy>(
+                                       _stereo_reader->get_frame (entry_point + frame),
+                                       picture_asset->size(),
+                                       dcp::Eye::LEFT,
+                                       AV_PIX_FMT_XYZ12LE,
+                                       _forced_reduction
                                        ),
                                _offset + frame
                                );
 
                        video->emit (
                                film(),
                                        ),
                                _offset + frame
                                );
 
                        video->emit (
                                film(),
-                               shared_ptr<ImageProxy> (
-                                       new J2KImageProxy (
-                                               _stereo_reader->get_frame (entry_point + frame),
-                                               picture_asset->size(),
-                                               dcp::Eye::RIGHT,
-                                               AV_PIX_FMT_XYZ12LE,
-                                               _forced_reduction
-                                               )
+                               std::make_shared<J2KImageProxy>(
+                                       _stereo_reader->get_frame (entry_point + frame),
+                                       picture_asset->size(),
+                                       dcp::Eye::RIGHT,
+                                       AV_PIX_FMT_XYZ12LE,
+                                       _forced_reduction
                                        ),
                                _offset + frame
                                );
                                        ),
                                _offset + frame
                                );
index 1ce3755..61ca1ae 100644 (file)
@@ -273,7 +273,7 @@ FFmpegEncoder::FileEncoderSet::get (Eyes eyes) const
                        eyes = Eyes::BOTH;
                } else if (eyes == Eyes::RIGHT) {
                        /* ...and ignore the right eye.*/
                        eyes = Eyes::BOTH;
                } else if (eyes == Eyes::RIGHT) {
                        /* ...and ignore the right eye.*/
-                       return shared_ptr<FFmpegFileEncoder>();
+                       return {};
                }
        }
 
                }
        }
 
index 29ee745..f253c73 100644 (file)
@@ -416,7 +416,7 @@ FFmpegFileEncoder::video (shared_ptr<PlayerVideo> video, DCPTime time)
        }
 
        for (int i = 0; i < 3; ++i) {
        }
 
        for (int i = 0; i < 3; ++i) {
-               AVBufferRef* buffer = av_buffer_create(image->data()[i], image->stride()[i] * image->size().height, &buffer_free, this, 0);
+               auto buffer = av_buffer_create(image->data()[i], image->stride()[i] * image->size().height, &buffer_free, this, 0);
                frame->buf[i] = av_buffer_ref (buffer);
                frame->data[i] = buffer->data;
                frame->linesize[i] = image->stride()[i];
                frame->buf[i] = av_buffer_ref (buffer);
                frame->data[i] = buffer->data;
                frame->linesize[i] = image->stride()[i];