With certain audio encoders, gaps can be introduced into the audio
packets, causing the audio duration to be miscalculated because it
calculated audio duration based upon the PTS of the current packet to
the last packet. However, this audio encoder also did not store
timestamps for most of its audio packets, causing PTS values to be
calculated based upon duration values. So those two things combined
caused audio timestamps to go all out of whack when playing back certain
videos with the media source. This is particularly prevalent with WMV
files using Microsoft codecs.
So to fix it, when the duration needs to be calculated, just calculate
the duration based upon the sample count of the audio packet. This fixes
the issue with the video in question that caused problems, and likely
fixes issues in a lot of videos that may have been floating out there
for some time. Basically this is a fix for a potential long-standing
issue.
Closesobsproject/obs-studio#3683
Returning PyObject with borrowed reference will result in double free
and/or use after free issue. Issue seen as crash when running Python
script calling script_path().
Fixes a bug where playback would completely stop when manually seeking
to the end of the file. Playback should not officially stop until
playback has unpaused.
If seeking occurs too close to the previous time value, it could cause
the playback to delay an abnormal amount of time, or if the time value
is under the previous value, then it would cause an assert. So instead,
reset the next timestamp value to be instant in both cases if a seek
occurs to ensure timely playback.
(Note: This commit also modifies deps/media-playback)
Co-authored-by: Eric Lindvall <eric@5stops.com>
Co-authored-by: Ryan Foster <RytoEX@gmail.com>
Co-authored-by: Jim <obs.jim@gmail.com>
FFmpeg YUV to RGB conversions require extra destination padding.
The Mantis issue might have been fixed when some YUV format conversions
were moved to the GPU, but this may fix other YUV formats.
Fixes https://obsproject.com/mantis/view.php?id=1177
Instead of erroring out completely when it can't determine if the
certificate is valid, proceed anyway. This matches how web browsers
treat failed cert revocation checks. schannel just has somewhat
paranoid defaults.
Add PyDict_New and PyTuple_New to obs-scripting-python-import.[ch];
these functions are used by SWIG's generated code when I build OBS on
macOS with SWIG 4.0.1.
When using an IP camera on a local network, we wanted to minimize
delay. In order to achieve minimum delay, we allowed Media Source to
set BufferingMB to 0, and when it is 0, also enable AVFMT_FLAG_NOBUFFER
in the AVFormatContext flags.
SIMDE was introduced for aarch64 support, however, the library itself
supports non-SIMD fallback, which allows us provide support to other
platforms without code changes.
There is another world beyond x86. So we can simply enable SIMDE for
processors without SSE2 support.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
This fixes an issue where local files were using the avformat interrupt
callback, which is only supposed to be use to prevent blocking on
network calls.
The interrupt callback is designed to prevent the media source from
blocking; FFmpeg will internally call it periodically to prevent FFmpeg
function calls from blocking too long, and allow the caller to determine
whether blocking should stop.
The problem with this however is that AVERROR_EXIT causes the thread to
completely exit. This fixes it so that it treats it as an EOF rather
than as an abnormal error.