Skip to content

Commit

Permalink
符号なし演算の修正
Browse files Browse the repository at this point in the history
  • Loading branch information
xtne6f committed Feb 21, 2018
1 parent dbc174c commit d165577
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/TsSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ bool CTsSender::Seek(int msec)
if (!Seek(approx, IReadOnlyFile::MOVE_METHOD_BEGIN)) return false;

// 移動分を差し引く
msec += MSB(m_pcr-prevPcr) ? (int)(prevPcr-m_pcr) / PCR_PER_MSEC :
-(int)(m_pcr-prevPcr) / PCR_PER_MSEC;
msec += MSB(m_pcr-prevPcr) ? (int)((prevPcr-m_pcr) / PCR_PER_MSEC) :
-(int)((m_pcr-prevPcr) / PCR_PER_MSEC);
}
if (msec < -5000 || 5000 < msec) return false;

Expand All @@ -637,7 +637,7 @@ bool CTsSender::Seek(int msec)

DWORD prevPcr = m_pcr;
if (!Seek(-rate * mul, IReadOnlyFile::MOVE_METHOD_CURRENT) || MSB(prevPcr-m_pcr)) return false;
msec += (int)(prevPcr-m_pcr) / PCR_PER_MSEC;
msec += (int)((prevPcr-m_pcr) / PCR_PER_MSEC);
// 動画レートが極端に小さいとき動かない可能性があるため
if (m_pcr == prevPcr) ++mul;
}
Expand All @@ -652,7 +652,7 @@ bool CTsSender::Seek(int msec)

DWORD prevPcr = m_pcr;
if (!Seek(rate, IReadOnlyFile::MOVE_METHOD_CURRENT) || MSB(m_pcr-prevPcr)) return false;
msec -= (int)(m_pcr-prevPcr) / PCR_PER_MSEC;
msec -= (int)((m_pcr-prevPcr) / PCR_PER_MSEC);
}
if (msec > 500) return false;
}
Expand Down

0 comments on commit d165577

Please sign in to comment.