player: do not drop trailing packets
This commit is contained in:
parent
ee46a189a6
commit
82b7345944
1 changed files with 1 additions and 2 deletions
|
@ -58,7 +58,6 @@ namespace Player{
|
||||||
char buff[1024 * 10];
|
char buff[1024 * 10];
|
||||||
if (fileSrc.good()){
|
if (fileSrc.good()){
|
||||||
fileSrc.read(buff, sizeof(buff));
|
fileSrc.read(buff, sizeof(buff));
|
||||||
if (fileSrc.eof()) return -1;
|
|
||||||
buffer.append(buff, fileSrc.gcount());
|
buffer.append(buff, fileSrc.gcount());
|
||||||
return fileSrc.gcount();
|
return fileSrc.gcount();
|
||||||
}
|
}
|
||||||
|
@ -177,7 +176,7 @@ seekDone:
|
||||||
|
|
||||||
void File::Play() {
|
void File::Play() {
|
||||||
long long now, timeDiff = 0, lastTime = 0;
|
long long now, timeDiff = 0, lastTime = 0;
|
||||||
while (fileSrc.good()) {
|
while (fileSrc.good() || !inBuffer.empty()) {
|
||||||
if (readCommand()) {
|
if (readCommand()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue