OBS Studio - Free from stubborn peops https://obsproject.com
Find a file
jp9000 2d7cda18e9 libobs/util: Fix rounding error with os_sleepto_ns()
os_sleepto_ns() can occasionally return false on times that the
processor may not have reached yet. The reason is because the
count_target, which converts time_target into a QPC counter, is subject
to a rounding error.

Using numbers I generated from an actual clock cycle on my own CPU, I
can show an example of this occurring: if the clock frequency value is
10000000.0, and you call os_sleepto_ns(42164590320600), it will convert
that number first to a double floating point of its QPC value:
421645903205.99994. Then, because it converts that to a LONGLONG
integer, it of course strips off the decimal point. If you convert
421645903205 *back* to a time value, the new value will be
42164590320500, which is lower than the original value by approximately
100 nanoseconds. While this may seem insignificant, it was apparently
enough to cause the os_sleepto_ns() call in video_sleep() to sometimes
return false despite the current time being lower than the target time,
which would cause it to incorrectly calculate how many frames were
duplicated by subtracting the frame time from the current system time,
divide that by the current frame interval, set the vframe_info.count
value to 0, and thus cause an infinite loop in the encode_gpu()
function because queue_frame now starts returning negative numbers in
perpetuity.

This change fixes some rare reports of users having their video lock up
and disconnect, forcing the user to have to forcibly shut down the
program.

Thanks to Twitch user SNLabat for having the patience to kindly provide
us with a dump file from the freeze, and to Matt for coordinating with
that user to obtain it from them.
2022-02-28 22:22:29 +11:00
.github CI: Update workflow to copy SOVERSION symlinks 2022-02-22 17:17:25 -05:00
additional_install_files Improve additional_install_files for debug/release 2014-07-18 22:41:11 -07:00
CI CI: Ensure SOVERSION symlinks exist in created App Bundle 2022-02-20 12:05:54 +11:00
cmake cmake: Add libRIST to copied Windows libs 2021-12-23 18:14:16 +11:00
deps libobs: Deprecate obs object addref functions 2022-01-25 05:20:03 -08:00
docs/sphinx docs/sphinx: Add GS_RG16 2022-01-29 15:12:00 -08:00
libobs libobs/util: Fix rounding error with os_sleepto_ns() 2022-02-28 22:22:29 +11:00
libobs-d3d11 libobs, libobs-d3d11, libobs-opengl: Add GS_RG16 2022-01-29 15:12:00 -08:00
libobs-opengl libobs, libobs-d3d11, libobs-opengl: Add GS_RG16 2022-01-29 15:12:00 -08:00
libobs-winrt libobs-winrt: Require Windows 10 SDK 20348 2021-09-11 13:00:28 -07:00
plugins linux-v4l2: scandir with alphasort on non-Linux 2022-02-28 22:21:46 +11:00
test CI: Add extra rpath for macOS test binaries 2021-12-06 01:12:29 -06:00
UI UI: Additional product details 2022-02-28 22:22:09 +11:00
.cirrus.yml CI: Fix swig dependency on FreeBSD 2020-10-03 05:38:46 -07:00
.clang-format Apply clang-format to objective c code 2019-07-09 13:39:13 -05:00
.editorconfig .editorconfig: Add file to speed up editor configuration 2017-06-14 21:35:09 -05:00
.git-blame-ignore-revs .git-blame-ignore-revs: Add file to handle mass reformatting 2019-06-27 01:09:31 +09:00
.gitattributes CI: Add Crowdin Synchronization 2021-11-25 20:59:11 +11:00
.gitignore .gitignore: Add flatpak-builder folders 2021-11-24 17:48:26 -03:00
.gitmodules enc-amf: Update to 2.5.0.1 and update repository address 2018-09-28 10:54:19 +02:00
.mailmap .mailmap: Disambiguate many more authors 2021-01-11 17:45:01 -08:00
AUTHORS Update translations from Crowdin 2022-02-11 00:34:08 +00:00
CMakeLists.txt libobs, UI: Add support for beta builds 2021-12-27 10:01:07 -08:00
COC.rst Revert "docs: Rename Code of Conduct to fix GitHub detection" 2021-08-07 20:40:29 +10:00
COMMITMENT Add GPL Cooperation Commitment to base directory 2019-01-24 02:02:49 -05:00
CONTRIBUTING.rst CONTRIBUTING.rst: Add service submission guidelines (#5562) 2021-11-22 08:29:39 -06:00
COPYING COPYING: Use license file from gnu.org 2021-10-24 00:35:27 -07:00
formatcode.sh aja: Capture and Output plugin for AJA Video Systems IO devices 2021-11-23 20:31:11 -06:00
INSTALL Update INSTALL 2018-07-14 08:21:00 +01:00
README.rst docs: Remove block quotes (#4621) 2021-05-01 19:46:54 -05:00

OBS Studio <https://obsproject.com>
===================================

.. image:: https://github.com/obsproject/obs-studio/actions/workflows/main.yml/badge.svg?branch=master&event=push
   :alt: OBS Studio Build Status - GitHub Actions
   :target: https://github.com/obsproject/obs-studio/actions/workflows/main.yml?query=event%3Apush+branch%3Amaster

.. image:: https://d322cqt584bo4o.cloudfront.net/obs-studio/localized.svg
   :alt: OBS Studio Translation Project Progress
   :target: https://crowdin.com/project/obs-studio

.. image:: https://img.shields.io/discord/348973006581923840.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2
   :alt: OBS Studio Discord Server
   :target: https://obsproject.com/discord

What is OBS Studio?
-------------------

OBS Studio is software designed for capturing, compositing, encoding,
recording, and streaming video content, efficiently.

It's distributed under the GNU General Public License v2 (or any later
version) - see the accompanying COPYING file for more details.

Quick Links
-----------

- Website: https://obsproject.com

- Help/Documentation/Guides: https://github.com/obsproject/obs-studio/wiki

- Forums: https://obsproject.com/forum/

- Build Instructions: https://github.com/obsproject/obs-studio/wiki/Install-Instructions

- Developer/API Documentation: https://obsproject.com/docs

- Donating/backing/sponsoring: https://obsproject.com/contribute

- Bug Tracker: https://github.com/obsproject/obs-studio/issues

Contributing
------------

- If you would like to help fund or sponsor the project, you can do so
  via `Patreon <https://www.patreon.com/obsproject>`_, `OpenCollective
  <https://opencollective.com/obsproject>`_, or `PayPal
  <https://www.paypal.me/obsproject>`_.  See our `contribute page
  <https://obsproject.com/contribute>`_ for more information.

- If you wish to contribute code to the project, please make sure to
  read the coding and commit guidelines:
  https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst

- Developer/API documentation can be found here:
  https://obsproject.com/docs

- If you wish to contribute translations, do not submit pull requests.
  Instead, please use Crowdin.  For more information read this thread:
  https://obsproject.com/forum/threads/how-to-contribute-translations-for-obs.16327/

- Other ways to contribute are by helping people out with support on
  our forums or in our community chat.  Please limit support to topics
  you fully understand -- bad advice is worse than no advice.  When it
  comes to something that you don't fully know or understand, please
  defer to the official help or official channels.