diff --git a/mythtv/libs/libmythtv/avformatdecoder.cpp b/mythtv/libs/libmythtv/avformatdecoder.cpp
index 832967c..5b349b3 100644
a
|
b
|
AvFormatDecoder::AvFormatDecoder(MythPlayer *parent, |
431 | 431 | cc608_build_parity_table(cc608_parity_table); |
432 | 432 | |
433 | 433 | SetIdrOnlyKeyframes(true); |
| 434 | m_audioReadAhead = gCoreContext->GetNumSetting("AudioReadAhead", 250); |
434 | 435 | |
435 | | LOG(VB_PLAYBACK, LOG_DEBUG, LOC + QString("PlayerFlags: 0x%1") |
436 | | .arg(playerFlags, 0, 16)); |
| 436 | LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("PlayerFlags: 0x%1, AudioReadAhead: %2 msec") |
| 437 | .arg(playerFlags, 0, 16).arg(m_audioReadAhead)); |
437 | 438 | } |
438 | 439 | |
439 | 440 | AvFormatDecoder::~AvFormatDecoder() |
… |
… |
bool AvFormatDecoder::GetFrame(DecodeType decodetype) |
4904 | 4905 | |
4905 | 4906 | if (gotVideoFrame) |
4906 | 4907 | { |
| 4908 | int adjust = 0; |
| 4909 | if (lowbuffers) |
| 4910 | adjust = 100; |
4907 | 4911 | if (decodetype == kDecodeNothing) |
4908 | 4912 | { |
4909 | 4913 | // no need to buffer audio or video if we |
… |
… |
bool AvFormatDecoder::GetFrame(DecodeType decodetype) |
4913 | 4917 | } |
4914 | 4918 | else if ((decodetype & kDecodeAV) == kDecodeAV && |
4915 | 4919 | (storedPackets.count() < max_video_queue_size) && |
4916 | | lastapts < (lowbuffers ? lastvpts + 100 : lastvpts) && |
| 4920 | // buffer audio to prevent audio buffer |
| 4921 | // underruns in case you are setting negative values |
| 4922 | // in Adjust Audio Sync. |
| 4923 | lastapts < lastvpts + adjust + m_audioReadAhead && |
4917 | 4924 | !ringBuffer->IsInStillFrame()) |
4918 | 4925 | { |
4919 | 4926 | storevideoframes = true; |
diff --git a/mythtv/libs/libmythtv/avformatdecoder.h b/mythtv/libs/libmythtv/avformatdecoder.h
index 5d1bcfb..9573364 100644
a
|
b
|
class AvFormatDecoder : public DecoderBase |
372 | 372 | bool codec_is_mpeg; |
373 | 373 | bool m_processFrames; |
374 | 374 | bool m_streams_changed; |
| 375 | // Value in milliseconds, from setting AudioReadAhead |
| 376 | int m_audioReadAhead; |
375 | 377 | }; |
376 | 378 | |
377 | 379 | #endif |