ITarget<audio_decoder::target_element_t>& target_;\r
\r
governor governor_;\r
- tbb::atomic<bool> is_running_;\r
\r
public:\r
explicit implementation(audio_decoder::source_t& source, audio_decoder::target_t& target, AVFormatContext& context, const core::video_format_desc& format_desc) \r
\r
source.link_target(&source_);\r
\r
- is_running_ = true;\r
start();\r
}\r
\r
~implementation()\r
{\r
- is_running_ = false;\r
- governor_.cancel();\r
agent::wait(this);\r
}\r
\r
\r
try\r
{\r
- while(is_running_)\r
+ while(true)\r
{ \r
auto ticket = governor_.acquire();\r
auto packet = receive(source_);\r
~ffmpeg_producer()\r
{\r
input_.stop(); \r
+ while(Concurrency::receive(frames_).first != core::basic_frame::eof()){}\r
}\r
\r
virtual safe_ptr<core::basic_frame> receive(int hints)\r
\r
~implementation()\r
{\r
- governor_.cancel();\r
agent::wait(this);\r
}\r
\r
auto ticket = governor_.acquire();\r
\r
auto video = receive_video();\r
- video->audio_data() = std::move(*receive_audio());\r
-\r
if(!video)\r
break;\r
\r
+ auto audio = receive_audio();\r
+\r
+ if(!audio)\r
+ break;\r
+\r
+ video->audio_data() = std::move(*audio);\r
+ \r
switch(display_mode_.value())\r
{\r
case display_mode::simple: \r
ITarget<video_decoder::target_element_t>& target_;\r
\r
governor governor_;\r
- tbb::atomic<bool> is_running_;\r
\r
public:\r
explicit implementation(video_decoder::source_t& source, video_decoder::target_t& target, AVFormatContext& context) \r
\r
source.link_target(&source_);\r
\r
- is_running_ = true;\r
start();\r
}\r
\r
~implementation()\r
{\r
- is_running_ = false;\r
- governor_.cancel();\r
agent::wait(this);\r
}\r
\r
\r
try\r
{\r
- while(is_running_)\r
+ while(true)\r
{\r
auto ticket = governor_.acquire();\r
auto packet = receive(source_);\r