Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 1 PES 2 AU problem #819

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tsMuxer/hevcStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,12 @@ int HEVCStreamReader::intDecodeNAL(uint8_t* buff)
if (m_eof)
{
m_lastDecodedPos = m_bufEnd;
if (sliceFound && !m_flush)
{
// we expect there will not be any more data because EOF is met, if we found any slice, we can update DTS
// PTS such that the found slice could be wrapped in a new PES
incTimings();
}
return 0;
}
return NEED_MORE_DATA;
Expand Down
1 change: 1 addition & 0 deletions tsMuxer/mpegStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void MPEGStreamReader::setBuffer(uint8_t* data, const uint32_t dataLen, const bo
int MPEGStreamReader::flushPacket(AVPacket& avPacket)
{
m_eof = true;
m_flush = true;
avPacket.codec = this;
avPacket.duration = 0;
avPacket.data = nullptr;
Expand Down
2 changes: 2 additions & 0 deletions tsMuxer/mpegStreamReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class MPEGStreamReader : public AbstractStreamReader
m_tmpBufferLen = 0;
setFPS(0);
m_eof = false;
m_flush = false;
m_lastDecodeOffset = LONG_MAX;
m_tmpBuffer = new uint8_t[TMP_BUFFER_SIZE];
m_lastDecodedPos = nullptr;
Expand Down Expand Up @@ -66,6 +67,7 @@ class MPEGStreamReader : public AbstractStreamReader
int64_t m_curDts;
int64_t m_processedBytes;
bool m_eof;
bool m_flush;
double m_fps;
int64_t m_pcrIncPerFrame;
int64_t m_pcrIncPerField;
Expand Down
Loading