mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Added an audio buffer to VideoFFmpegComponent to avoid underflows and distortion.
This commit is contained in:
parent
f3f86c6e20
commit
4465342724
|
@ -445,9 +445,10 @@ void VideoFFmpegComponent::outputFrames()
|
|||
}
|
||||
}
|
||||
|
||||
// Process all available audio frames that have a pts value below mAccumulatedTime.
|
||||
// Process the audio frames that have a pts value below mAccumulatedTime (plus a small
|
||||
// buffer to avoid underflows).
|
||||
while (!mAudioFrameQueue.empty()) {
|
||||
if (mAudioFrameQueue.front().pts < mAccumulatedTime) {
|
||||
if (mAudioFrameQueue.front().pts < mAccumulatedTime + AUDIO_BUFFER) {
|
||||
// Enable only when needed, as this generates a lot of debug output.
|
||||
// LOG(LogDebug) << "Processing audio frame with PTS: " <<
|
||||
// mAudioFrameQueue.front().pts;
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
#ifndef ES_CORE_COMPONENTS_VIDEO_FFMPEG_COMPONENT_H
|
||||
#define ES_CORE_COMPONENTS_VIDEO_FFMPEG_COMPONENT_H
|
||||
|
||||
#define VIDEO_FRAME_QUEUE_SIZE 3
|
||||
// Audio buffer in seconds.
|
||||
#define AUDIO_BUFFER 0.2l
|
||||
|
||||
#include "VideoComponent.h"
|
||||
|
||||
|
|
Loading…
Reference in a new issue