]> git.sesse.net Git - nageru/commitdiff
Fix a threading issue during shutdown (two threads would try to encode audio at the...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 19 Apr 2016 00:09:44 +0000 (02:09 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 19 Apr 2016 00:09:44 +0000 (02:09 +0200)
h264encode.cpp

index 26922987620e9cfe07f186224dc4984c4a5bcef6..5f4ace9889844b298be4d9571c12ca9c22e8f02c 100644 (file)
@@ -2145,6 +2145,7 @@ void H264EncoderImpl::shutdown()
                storage_task_queue_changed.notify_all();
        }
        storage_thread.join();
+       encode_remaining_audio();
 
        release_encode();
        deinit_va();
@@ -2267,7 +2268,6 @@ void H264EncoderImpl::encode_thread_func()
                                // but nobody else uses it at this point, since we're shutting down,
                                // so there's no contention.
                                encode_remaining_frames_as_p(encoding_frame_num, gop_start_display_frame_num, last_dts);
-                               encode_remaining_audio();
                                return;
                        } else {
                                frame = move(pending_video_frames[display_frame_num]);