mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-04-21 03:55:04 +00:00
完善解码器读取错误处理
This commit is contained in:
parent
d61f0521d0
commit
c38c7fe42f
1 changed files with 11 additions and 4 deletions
|
@ -56,10 +56,17 @@ qint32 Decoder::recvData(quint8* buf, qint32 bufSize)
|
|||
if (!buf) {
|
||||
return 0;
|
||||
}
|
||||
if (m_deviceSocket) {
|
||||
return m_deviceSocket->recvData(buf, bufSize);
|
||||
}
|
||||
return 0;
|
||||
if (m_deviceSocket) {
|
||||
qint32 len = m_deviceSocket->recvData(buf, bufSize);
|
||||
if (len == -1) {
|
||||
return AVERROR(errno);
|
||||
}
|
||||
if (len == 0) {
|
||||
return AVERROR_EOF;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
return AVERROR_EOF;
|
||||
}
|
||||
|
||||
bool Decoder::startDecode()
|
||||
|
|
Loading…
Add table
Reference in a new issue