mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libeplayer3: skip video until first audio frame was found
This commit is contained in:
@@ -88,6 +88,8 @@ bool Input::Play()
|
|||||||
int warnAudioWrite = 0;
|
int warnAudioWrite = 0;
|
||||||
int warnVideoWrite = 0;
|
int warnVideoWrite = 0;
|
||||||
|
|
||||||
|
bool audioSeen = !audioTrack; // HACK: Drop all video frames until the first audio frame was seen to keep player2 from stuttering.
|
||||||
|
|
||||||
while (player->isPlaying && !player->abortRequested) {
|
while (player->isPlaying && !player->abortRequested) {
|
||||||
|
|
||||||
//IF MOVIE IS PAUSED, WAIT
|
//IF MOVIE IS PAUSED, WAIT
|
||||||
@@ -178,7 +180,7 @@ bool Input::Play()
|
|||||||
|
|
||||||
if (_videoTrack && (_videoTrack->stream == stream)) {
|
if (_videoTrack && (_videoTrack->stream == stream)) {
|
||||||
int64_t pts = calcPts(stream, packet.pts);
|
int64_t pts = calcPts(stream, packet.pts);
|
||||||
if (!player->output.Write(stream, &packet, pts)) {
|
if (audioSeen && !player->output.Write(stream, &packet, pts)) {
|
||||||
if (warnVideoWrite)
|
if (warnVideoWrite)
|
||||||
warnVideoWrite--;
|
warnVideoWrite--;
|
||||||
else {
|
else {
|
||||||
@@ -202,6 +204,7 @@ bool Input::Play()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
audioSeen = true;
|
||||||
} else if (_subtitleTrack && (_subtitleTrack->stream == stream)) {
|
} else if (_subtitleTrack && (_subtitleTrack->stream == stream)) {
|
||||||
if (stream->codec->codec) {
|
if (stream->codec->codec) {
|
||||||
AVSubtitle sub;
|
AVSubtitle sub;
|
||||||
|
@@ -129,7 +129,7 @@ bool WriterPCM::prepareClipPlay()
|
|||||||
SubFrameLen *= uBitsPerSample / 8;
|
SubFrameLen *= uBitsPerSample / 8;
|
||||||
|
|
||||||
//rewrite PES size to have as many complete subframes per PES as we can
|
//rewrite PES size to have as many complete subframes per PES as we can
|
||||||
SubFramesPerPES = ((sizeof(injectBuffer) - 18) - sizeof(lpcm_prv)) / SubFrameLen;
|
SubFramesPerPES = ((sizeof(injectBuffer) - 14) - sizeof(lpcm_prv)) / SubFrameLen;
|
||||||
SubFrameLen *= SubFramesPerPES;
|
SubFrameLen *= SubFramesPerPES;
|
||||||
|
|
||||||
//set number of channels
|
//set number of channels
|
||||||
|
Reference in New Issue
Block a user