]> git.sesse.net Git - casparcg/commitdiff
Fixed bug where audio wasn't routed via layer_producer and channel_producer.
authorHelge Norberg <helge.norberg@svt.se>
Mon, 3 Nov 2014 11:52:58 +0000 (12:52 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Mon, 3 Nov 2014 12:01:54 +0000 (13:01 +0100)
TODO: support audio between layers/channels with 1001 modes and with different frame rate.

core/mixer/audio/audio_mixer.cpp
core/producer/channel/channel_producer.cpp

index 85176c883055eddc4ee5594449c2a4d75bbe3ea8..09e71203bd392a43bce570d18152a002456e229e 100644 (file)
@@ -131,7 +131,7 @@ public:
                }\r
                else\r
                {\r
-                       item.audio_data = std::move(frame.audio_data()); // Note: We don't need to care about upper/lower since audio_data is removed/moved from the last field.\r
+                       item.audio_data = frame.audio_data(); // Note: We don't need to care about upper/lower since audio_data is removed/moved from the last field.\r
                }\r
                \r
                items_.push_back(std::move(item));              \r
index e4658fd78d7301b7258bf0fb8c59f99b766fdf87..3e033acdefefb37370c2546ac26f69cc0b31e7a5 100644 (file)
@@ -231,7 +231,15 @@ public:
 \r
                desc.pix_fmt = core::pixel_format::bgra;\r
                desc.planes.push_back(core::pixel_format_desc::plane(format_desc.width, format_desc.height, 4));\r
-               auto frame = frame_factory_->create_frame(this, desc);\r
+               auto frame = frame_factory_->create_frame(this, desc, read_frame->multichannel_view().channel_layout());\r
+\r
+               bool copy_audio = !double_speed && !half_speed;\r
+\r
+               if (copy_audio)\r
+               {\r
+                       frame->audio_data().reserve(read_frame->audio_data().size());\r
+                       boost::copy(read_frame->audio_data(), std::back_inserter(frame->audio_data()));\r
+               }\r
 \r
                fast_memcpy(frame->image_data().begin(), read_frame->image_data().begin(), read_frame->image_data().size());\r
                frame->commit();\r